Forums

[resolved] Adding "More" tag to a new page (7 posts)

  1. jay0000
    Member
    Posted 1 year ago #

    I've tried to add the 'more' tag on a new page but for some reason it doesn't show up once i publish it. is the 'more' tag only workable when creating a post? if so, are there any easy, quick alternatives?
    thanks

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    for more to work on pages, you need extra code above the_content like:

    <?php
    global $more;
    $more = 0;
    ?>
    
    			<?php the_content('<span class="details">Additional Details</span>'); ?>
  3. jay0000
    Member
    Posted 1 year ago #

    So to confirm it should look like this..? Would this go in the html code of the page also? - thanks

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

    text text text

    <?php the_content('<span class="details">Additional Details</span>'); ?>

    More text text text

  4. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    no.... it goes in the actual template in the theme...

    so probably page.php

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

    goes above whatever the_content line you already have in there, I was just including mine to give you an idea where it goes

    Then the more button works like normal

    http://codex.wordpress.org/Customizing_the_Read_More#How_to_use_Read_More_in_Pages

    However, I gotta know what you are trying to accomlish? Is this just a normal page? Or a page template showing certain posts?

  5. jay0000
    Member
    Posted 1 year ago #

    its just a separate page with a bunch of information on it, i just want the option for people to see the first few things, and if they choose, expand for the rest of the information. ill try that code in the php file though. thanks

  6. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    OK, that's handled differently. You don't just use the more like in a post, you use this

    <!–nextpage–>

    but your theme needs to support it

    wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number'));

    something like this in your loop will add support

  7. jay0000
    Member
    Posted 1 year ago #

    thanks i'll try that. much appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic