• Resolved nickaster

    (@nickaster)


    Hi – by default on my front page, I get a “this post continues” link, which makes sense because 99% of the time the post is longer and continues on the permalink page.

    If I make a short post, the continue button is stil there. I’d like it to NOT be there unless needed. How do I do this? Here’s the code I have on my front page:

    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> CONTINUES &raquo;</a>

    As you can see, there’s no if/then thing in there about weather the most is using the “more” feature.

    How do I change this?

    Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Assuming you’re using a combination of the_content and the <!–more–> tag, you could try testing for the presence of the <!–more–> tag and only generate a more link if the more tag has been used>

    <?php the_content('');;?>
    <?php if( strpos($post->post_content, '<!--more-->') ) :?><a class="more-link" href="<?php the_permalink();?>"><?php _e('this post continues');?> <?php the_title();?></a><?php endif;?>
    Thread Starter nickaster

    (@nickaster)

    esmi, thanks a million. Yeah, I’m using <!–more–> … your suggestion did something really weird – it printed out the first section of every post 2x and ignored the second part alltogether…

    Any idea what went wrong? Thanks!

    Thread Starter nickaster

    (@nickaster)

    Got any other ideas for how this might work? I know it was standard back in the movable type days…would this require a plugin?

    it printed out the first section of every post 2x and ignored the second part alltogether…

    difficult to tell without getting the whole picture.

    could you paste the whole index.php (assuming that this is what you are working on) in a https://wordpress.pastebin.com/ and post the link to it here?
    a link to your site might further help to illustrate your ‘problem’

    Thread Starter nickaster

    (@nickaster)

    Right on, thanks! Here it is:

    https://wordpress.pastebin.com/WwxkRWnX

    pastebin link is either expired or unknown ??

    Thread Starter nickaster

    (@nickaster)

    hmm… that’s weird. I just tested it in a couple browsers and on someone else’s machine… they say it worked.

    Thread Starter nickaster

    (@nickaster)

    That paste bin still failing?

    pastebin must have been in maintenance;
    as far as i can interprete your code, this should be what @esmi suggested, integrated into place:

    <div class="entry">
              <?php the_content('',FALSE,''); ?>
    
              <p class="more"><img src="<?php bloginfo('template_url');?>/images/page_white_text.png"  alt="Permalink" />
    <?php if( strpos($post->post_content, '<!--more-->') ) :?>
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> CONTINUES &raquo;</a>
    <?php endif;?>
    <img src="<?php bloginfo('template_url');?>/images/usergroup2-vi.gif" /> <a href="<?php the_permalink() ?>">Discuss This &raquo;</a></p>
    </div>

    unless some plugin interferes with it, i can’t see any reason why this would not work.

    Thread Starter nickaster

    (@nickaster)

    Phenomenal! IT worked! Thank You!!!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Having “continue” only appear when needed…’ is closed to new replies.