3613 readersWordPress 3.0 will allow you to create custom post types, so what about being able to list those custom types on your blog homepage? This very useful piece of code will show you how you can do it.Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for
-
118 readersThe manual Excerpt in WordPress. What, why, how, tips and plugins.: Demetris has a written a very nice, well illustrated and explained tutorial on the WordPress excerpt and how to manipulate it to take full advantage of it.
WordPress excerpts, which are not excerpts, make a WordPress site easier to browse and its content easier to
4260 readersIntroduced in WordPress 2.9, get_the_post_thumbnail() allow you to display a thumbnail in your posts. But what about displaying post thumbnails in RSS feeds? Just read this recipe to know how to do.Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!WordPress hack: Display post thumbnail in
-
4818 readersYou're reading the RSS Feed of BP-Trick.com a tips and tricks community dedicated to making sharing BuddyPress knowledge easy!. We also sell Premium Themes! View the original post here: Use a custom excerpt in the Activity Stream for blog postsSometimes you want to have full control over the excerpt that is shown in the activity
6185 readers
PHP
add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1);
add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1);
add_filter('page_css_class', 'my_css_attributes_filter', 100, 1);
function my_css_attributes_filter($var) {
return is_array($var) ? array_intersect($var, array('current-menu-item')) : '';
}
Visit wpsnipp.com for details on how to setup this WordPress snippet. Share this post. Facebook | StumbleUpon | Delicious | Tweet It | Digg This | DesignBump-It | DesignPoke-it
7503 readers
PHP
add_filter( 'getarchives_where' , 'ucc_getarchives_where_filter' , 10 , 2 );
function ucc_getarchives_where_filter( $where , $r ) {
$args = array( 'public' => true , '_builtin' => false );
$output = 'names'; $operator = 'and';
$post_types = get_post_types( $args , $output , $operator );
$post_types = array_merge( $post_types , array( 'post','CUSTOM_POST_TYPE_NAME' ) );
$post_types = "'" . implode( "' , '" , $post_types
9858 readers
PHP
function mfields_add_more_to_post_class( $classes ) {
global $post;
if ( ( is_archive() || is_home() ) && false !== strpos( $post->post_content, '' ) && ! in_array( 'more', $classes ) ) {
$classes[] = 'more';
}
return $classes;
}
add_filter( 'post_class',
-
2618 readersSometimes you don't like to display every post and page on search results. Today I like to show you how to filter the search in your frontend. Therefore I add a filter to the query of WordPress and exclude the according posts or pages of the search. We exclude posts and pages by their
5943 readersOne of the nice things about using WordPress’ new post-thumbnails feature is that they provide tons of flexibility in terms of where and how you display your post thumbnails. By design, post thumbnails are not included within post content, so they will not be displayed in your blog posts unless you call them specifically with
2416 readersSpam is a nuisance, and you know it. Happilly, WordPress users have Akismet, which help a lot to fight spam. But what about protecting your blog even more? This recipe might help.Looking for WordPress hosting? Try WP Web Host. Prices starts at $5/month and you can try it for free!Automatically refuse spam comments on your