After the break wordpress text

I like to add a little description of what’s to come when clicking read more on a wordpress article and sometimes add preview images and thumbs. Here’s a simple little way of adding an after_break tag for posts that is ignored when on the full page.

Add the following to your template function.

function after_the_break_shortcode( $atts, $content = null ) {
   if( !is_single() ){
    return $content;
   }else{
    return "";
   }
}
add_shortcode( 'after_break', 'after_the_break_shortcode' );

you can now enter

[after_break]
Click read more to check out some great photos from x
[/after_break]
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

Comments are closed.