• Resolved leraptor

    (@leraptor)


    I’d like to add some recurrent content between everything before the –More– tag, and the content of the post, and I want it only on the index template.

    Something in the effect of :

    Blog Home page :

    Blog Title A
    Blog Content A before MORE
    Custom Content
    Read More

    Blog Title B
    Blog Content B before MORE
    Custom Content
    Read More

Viewing 9 replies - 1 through 9 (of 9 total)
  • Is this the same content all the time?

    Thread Starter leraptor

    (@leraptor)

    Yes !

    Well, one way to do this would be to add the content to a file in your theme folder – stuff.php or whatever – just the content you want, nothing else, no doctype but styled how you want using html and css. Then use this line to put it where you want it:

    <?php include 'stuff.php'; ?>

    perhaps just above

    <?php the_excerpt('Read the rest of this entry &raquo;'); ?>

    if you’re using the_excerpt instead of the_content. If you’re using the More quicktag to break posts to your own specification, then the easiest way to do this would be to add the content to the More quicktag, depending on what that special content is.

    Final caveat: if you’re using the RTE, I can’t help you.

    Thread Starter leraptor

    (@leraptor)

    Thanks for this great answer !
    Is it possible to add JavaScript and use entire paragraph in the MORE tag or it’s just plain continuous HTM ?

    Hmmm. Good question. I’ve not tried js in the quicktags, so I don’t have an answer for you. Guess you get to be the guinea pig!

    One thing I did find out about tweaking the quicktags: EVERYTHING in the “operative area” of the quicktag MUST be “all in one line” – that is, NO WHITESPACE.

    Give it a shot, and if you get stuck, post back what you’ve got and we’ll look at it. If it’s very long code, please use https://wordpress.pastebin.ca/ and post the link here.

    Otherwise, be sure to use backticks around your code input here (that’s the flaky little symbol below the tilde on the key just left of the numeral one key on English keyboards).

    Thread Starter leraptor

    (@leraptor)

    Thanks alot ! I’ll be sure to report back once I try it. Thanks again,

    An automated, PHP option is to replace:

    <?php the_content(); ?>

    or the equivalent in your template with:

    https://wordpress.pastebin.ca/312755

    EDIT: Better working version:

    https://wordpress.pastebin.ca/312759

    Thread Starter leraptor

    (@leraptor)

    Whow, I can thank you enough guys, I’m feeling grateful!

    Thanks, this is also helpful for me.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Put something between Read More and the post’ is closed to new replies.