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

How to Arrange Support => Thumbnail

Pretty much what you can do is replace it, here’s what I use: /** Use “Featured Image” Box As A Custom Box **/ function post_type_featured_image() { add_meta_box( ‘postimagediv’, __(‘Your Custom Title Here’), ‘post_thumbnail_meta_box’, ‘YOUR_POST_TYPE_HERE’, ‘normal’, ‘high’ ); } add_action( ‘do_meta_boxes’, ‘post_type_featured_image’ ); As an explaination you can read up on the add_meta_box() function. You can … Read more