• I have the continue reading break in all my posts and it only seems to work when I view the posts in the category, in other words if I click on the category link and view all posts under that category. If I view them from the menu the continue reading is not on the post.

    Using WP TwentyTwelve with a child theme

Viewing 8 replies - 1 through 8 (of 8 total)
  • He,

    Please continue reading https://codex.www.ads-software.com/Customizing_the_Read_More ??

    This will help you

    Thread Starter wdb07159

    (@wdb07159)

    Thanks but I think this is a wee bit ahead of where I am at. It says enter the following code into “the loop”:

    <?php
    global $more;
    $more = 0;
    ?>
    //The code must be inserted ahead of the call to the content
    
    <?php the_content('Continue Reading'); ?>

    I’ve no idea what loop they are talking about?

    They talk about the loop, the loop refers to the code that starts with :
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    and finish with something like that :

    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>

    It’s simple…
    WHILE (start of the loop)
    ENDWHILE (end of the loop)

    So you’ve juste to insert :
    <?php the_content(‘Continue Reading’); ?>
    between the WHILE and the ENDWHILE.

    Usually just after the post entry.

    Thread Starter wdb07159

    (@wdb07159)

    I tried doing what was described here:

    https://www.ads-software.com/support/topic/how-to-use-read-more-tag-in-a-page?replies=7

    It is in the themes directory for example:

    TwentyEleven/page.php

    But the solution still doesn’t work

    It is anything to do with using 2012 theme maybe it’s set up different somehow?

    If I view them from the menu the continue reading is not on the post

    can you post a link to illustrate where you are linking from and what the result is?

    Thread Starter wdb07159

    (@wdb07159)

    Unfortunately none of what I read has worked. Posted code below with the extra code pasted with double line next to it (only for illustration purposes):

    <?php
    /**
     * The template for displaying all pages.
     *
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site will use a
     * different template.
     *
     * @package WordPress
     * @subpackage Twenty_Twelve
     * @since Twenty Twelve 1.0
     */
    
    get_header(); ?>
    
    	<div id="primary" class="site-content">
    		<div id="content" role="main">
    
    			<?php while ( have_posts() ) : the_post(); ?>
                           --<?php
                           --global $more;
                           --$more = 0;
                           --?>
                           --<?php the_content('Continue Reading'); ?>
    				<?php get_template_part( 'content', 'page' ); ?>
    				<?php comments_template( '', true ); ?>
    			<?php endwhile; // end of the loop. ?>
    
    		</div><!-- #content -->
    	</div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    I’m not sure, but your template here above is calling the content using another template to display posts ?

    <?php get_template_part( 'content', 'page' ); ?>

    No ?

    Thread Starter wdb07159

    (@wdb07159)

    If I only have one page, a static main page and the rest of content are posts called from the menu would this be why the code above is not working?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Continue reading Only Works in Category View’ is closed to new replies.