• Hi All,

    I am currently trying to work out how to use the read more tag/option on a wordpress page as opposed to a post.

    I have tried to follow the instructions I found on here but either I am getting it wrong (Highly likely) or it just doesn’t work any more.

    Can someone please explain how I can achieve this or even if it is possible?

    Thanks in advance

Viewing 6 replies - 1 through 6 (of 6 total)
  • I just tried it and it works.

    Added the following before the_content()

    <?php
    global $more;
    $more = 0;
    ?>

    as well as a more tag in the page.

    Thread Starter KWapshott

    (@kwapshott)

    Can you please tell me which file you added it to and where about exactly.

    If you don’t mind could you possibly post the content of the file you added it to.

    Many thanks

    In page.php before the_content();

    <?php get_header(); ?>
    
    <div id="body" class="container">
    	<div id="content">
    
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    			<h1><?php the_title(); ?></h1>
    			<div class="entry">
    				<?php
    				global $more;
    				$more = 0;
    				?>
    
    				<?php the_content(); ?>
    
    				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    
    			</div>
    		</div>
    		<?php endwhile; endif; ?>
    
    	</div>
    <?php get_sidebar(); ?>
    </div>
    <?php get_footer(); ?>

    Thread Starter KWapshott

    (@kwapshott)

    My page.php doesn’t look like yours, mine looks like this:

    <?php get_header(); ?>
    
    <div id="content">
    
    	<div id="contentleft">
    
    		<div class="postarea">
    
    		<?php include(TEMPLATEPATH."/breadcrumb.php");?>
    
    			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <?php the_content(__('Read more'));?><div style="clear:both;"></div><?php edit_post_link('(Edit)', '', ''); ?>
    			<?php endwhile; else: ?>
    
    			<p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>
    
    		</div>
    
    	</div>
    
    <?php include(TEMPLATEPATH."/sidebar.php");?>
    
    </div>
    
    <!-- The main column ends  -->
    
    <?php get_footer(); ?>

    I’ve added it in for you:

    <?php get_header(); ?>
    
    <div id="content">
    
    	<div id="contentleft">
    
    		<div class="postarea">
    
    		<?php include(TEMPLATEPATH."/breadcrumb.php");?>
    
    			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    				<?php
    				global $more;
    				$more = 0;
    				?>
    
    <?php the_content(__('Read more'));?><div style="clear:both;"></div><?php edit_post_link('(Edit)', '', ''); ?>
    			<?php endwhile; else: ?>
    
    			<p><?php _e('Sorry, no posts matched your criteria.'); ?></p><?php endif; ?>
    
    		</div>
    
    	</div>
    
    <?php include(TEMPLATEPATH."/sidebar.php");?>
    
    </div>
    
    <!-- The main column ends  -->
    
    <?php get_footer(); ?>

    Thread Starter KWapshott

    (@kwapshott)

    HI Joseph,

    Many thanks for trying to help.

    However I have already tried the above (you inserted the code in the same place I did) but to no avail, it just doesn’t work – Hence my opening post

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How To Use Read More Tag In A Page?’ is closed to new replies.