WordPress.org

Ready to get started?Download WordPress

Forums

The more link isn't opening (7 posts)

  1. skinnymuldoon
    Member
    Posted 4 years ago #

    I have inserted the more link on my home page (set as a page, not posts), adding the ¢more declaration before the loop and it is displaying perfectly but when I click on the link it just reloads the same page and the not the extended information....

    Can anyone help?

    SM

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    The more tag doesn't work in Pages without some custom editing.

  3. skinnymuldoon
    Member
    Posted 4 years ago #

    I did say that I have edited the page and added the global $more after the loop and I get the 'read more' link to show up. When I click on it all I get is the page reloaded.

    What I need to do is find out how to make the 'read more' text actually link to the longer text?

    I am sorry if this wasn't clear,

    SM

  4. esmi
    Forum Moderator
    Posted 4 years ago #

    Did you also reset the $more variable?

  5. skinnymuldoon
    Member
    Posted 4 years ago #

    <?php if (have_posts()) : ?>
        <?php while (have_posts()) : the_post(); ?>
        <?php global $more;
    				$more = 0;
    		?>
        <li>
            <?php if (is_page() || is_single()) { ?>
            <h2 class="post-title"><?php the_title(); ?></h2>
            <?php } else { ?>
            <h2 class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
            <?php } ?>
                    <?php if((!is_page() or $options['metaenabled']) or $options['txtsizechange']) { ?>
            <div class="post-meta">
                <?php if(!is_page() or $options['metaenabled']) { ?>
                <div class="meta-left">
                    <p class="postdate"><?php the_time(__('M jS Y')) ?></p>
                    <p class="postauthor"><?php _e('By:');?> <?php the_author(); ?></p>
                </div>

    and further down.......

    `<?php if((!is_single() and !is_archive() and !is_search() and $options['excerptfront']) or (is_archive() and $options['excerptarchives']) or (is_search() and $options['excerptsearch'])) { ?>
    <?php the_excerpt(); ?>
    <?php } else { ?>
    <?php the_content('<span class="readmore">Read More</span>'); ?>
    <?php } ?>

    </div>`

    I hope this helps......

    Thank you,

    SM

  6. esmi
    Forum Moderator
    Posted 4 years ago #

    Try moving $more = 0; down to just before the_content()

    also:

    <?php if((!is_single() and !is_archive() and !is_search() and $options['excerptfront']) or (is_archive() and $options['excerptarchives']) or (is_search() and $options['excerptsearch'])) { ?>

    might be better written as:

    <?php if((!is_single() && !is_archive() && !is_search() && $options['excerptfront']) || ( (is_archive() && $options['excerptarchives']) ) || ) (is_search() && $options['excerptsearch']))) { ?>

  7. skinnymuldoon
    Member
    Posted 4 years ago #

    That still doesn't work - the page just reloads with the url /saldiving/#more-306.

    Thank you for the tips re the coding.....

    Any more ideas?

    SM

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags