get “read more” with custom DB query like you would with WP Query

The <!– more –> tag isn’t applied via the the_content filter, it’s included in the get_the_content() function, which checks for the existence of the tag within the content using a regex and then outputs the more link appropriately. this output is filtered via the the_content_more_link filter, but since you’re not using get_the_content() you won’t be … Read more

Template Body to posts

Simply add following code to your theme functions.php function better_default_post_content( $content ){ if( empty( $content ) ) $content = “Default Template is here!”; return $content; } add_filter( ‘the_editor_content’, ‘better_default_post_content’ ); With “the_editor_content” filter you can filter WordPress TinyCME editor value for changing values. In this code i added a filter for that. It’s so simple … Read more

How to show only Post titles on category pages

This little piece of code in your post.php displays the title: <h2 class=”title”>” title=”<?php printf( esc_attr__( ‘Permalink to %s’, ‘themater’ ), the_title_attribute( ‘echo=0’ ) ); ?>” rel=”bookmark”><?php the_title(); ?></h2> To be more precise, this bit does: <?php the_title(); ?> So if you only want the post titles visible in only archive.php. Just replace the line: … Read more

Correcting the content width when sidebar is inactive?

You could try something like this, within your sidebar.php file: if ( ! is_active_sidebar (‘SIDEBAR-NAME-OR-ID’ ) ) { echo ‘<style>.main-content { width: 960px; }</style>’; } This is hackish, but it should work for what you’re trying to do. There may be a better method but its hard to know without more context. The above code … Read more

Custom template for different post types

I’d recommend Custom Post Types : http://codex.wordpress.org/Post_Types#Custom_Post_Types You can add appropriate meta boxes to each post type : http://codex.wordpress.org/Function_Reference/add_meta_box You can define specific front end templates for each post type : http://codex.wordpress.org/Post_Types#Custom_Post_Type_Templates Instead of a dropdown, you would have distinct menu items for each “thing” ( Review, Albums, etc ).