Forums

[resolved] Tag (7 posts)

  1. Tokyo54
    Member
    Posted 1 year ago #

    Hi All,

    I'm wondering if anyone knows a way to hide the "(more...)" hyperlink that appears when you use the <!--more--> tag within posts, automatically if possible?

    I have looked at http://codex.wordpress.org/Customizing_the_Read_More but i'm afraid I'm a bit of wp newb and it doesn't make a great deal of sense to me.

    Help is much appreciated!

  2. Tokyo54
    Member
    Posted 1 year ago #

    More specifically, where should I place the

    <?php the_content('Read more...'); ?>

    instance?

    I have tried placing it within 'the loop' yet this seems to have no affect on the <!--more--> text that is displayed

  3. alchymyth
    The Sweeper
    Posted 1 year ago #

    you looked into the right docu:

    what you want is hidden under this sub-chapter:
    http://codex.wordpress.org/Customizing_the_Read_More#Link_Jumps_to_More_or_Top_of_Page

  4. Tokyo54
    Member
    Posted 1 year ago #

    Thanks alchymyth! Knew I was on the right track!

    I've tried inserting
    <?php the_content('Read more...'); ?>
    on it's own and also replacing
    the_content
    with it, e.g.

    <?php if($post->post_excerpt !== "") :
                                the_excerpt();
                            else :
                                the_content();
                            endif;
    
    Becomes
    
    <?php if($post->post_excerpt !== "") :
                                the_excerpt();
                            else :
                                the_content('Read more...');
                            endif;

    Yet my (more...) does not seem to change

  5. Mark / t31os
    Moderator
    Posted 1 year ago #

    You could use CSS..

    a.more-link { display:none }

    The more link has it's own class more-link, so that should work.. :)

  6. Tokyo54
    Member
    Posted 1 year ago #

    Thank you Mark, I really appreciate your help in learning WordPress!

    The CSS Method worked great, although my client has now asked for the (more) code to be replaced by 3 dots - [...]

    Would you be able to tell me how to ajust the the_content property in order to do this?

  7. Mark / t31os
    Moderator
    Posted 1 year ago #

    Ok, that's pretty simple, replace.

    the_content('Read more...');

    ..with..

    the_content('...');

    or

    the_content('[...]');

    As long as you leave the single quotes in place you can put whatever you like between them with exception to another single quote, which would need to be escaped, like so.. \'

    Hope that helps.. :)

Topic Closed

This topic has been closed to new replies.

About this Topic