1

I worked with site created on Theme Thirteen and theme uses
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?> to get post title, date, part of content and read-more link.
But now I need to show only post date and entire post content, but I can't find how to do that. If I try to use <?php the_content(); ?> I get the same if I use <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentythirteen' ) ); ?> How to get post date and entire post content in template ?

3

You probably have a read more tag in your posts, so you will need to remove them.

We can use the the_content filter to achieve that. We need to search and replace the <!--more--> tag with nothing.

You can try the following: (NOTE: The following code is untested)

add_filter( 'the_content', function ( $content )
{
    return str_replace( '<!--more-->', '', $content );
}, 11 );
|improve this answer|||||
  • 2
    A "dirty"-but-easy tricks is to set $GLOBALS['more'] = true – TheDeadMedic Nov 3 '15 at 10:40
  • @Heidel my pleasure. Enjoy :-) – Pieter Goosen Nov 4 '15 at 7:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.