WordPress.org

Ready to get started?Download WordPress

Forums

More tag with custom title link and image (4 posts)

  1. Scytle
    Member
    Posted 7 years ago #

    I am trying to get my more tags to display not only the title of the post but a picture as well.

    here is what i am using right now

    the_content("Read the rest of " . get_the_title('', '', false));

    and from reading the codec i know i have to add

    <img src="/images/leaf.gif"
    alt="read more" title="Read More..." />

    someplace...i just cant seem to figure out where to add that snipet of code, or perhaps i am not able to figure out the proper syntax.

    My suspicion is that the img src tag goes inside the content() someplace, but i cant seem to get the two (title in the more and image) to work at the same time.

    Every time i do it gives me an sql error (?) or keeps the page from loading anything at all.

    Any help would be greatly appreciated.

  2. Kafkaesqui

    Posted 7 years ago #

    Instead of simply bumping your topic (two of which I've deleted), perhaps if you might expand on how you want to accomplish this. You want the post title AND the image... how exactly? Perhaps like this?

    the_content('Read the rest of ' . get_the_title('', '', false) . ' <img src="/images/leaf.gif" alt="read more" title="Read More..." />');

  3. Scytle
    Member
    Posted 7 years ago #

    I am sorry for the bumps, but what you wrote worked like a charm :) I felt waiting a week between bumps was not sooo bad. Thank you for the answer.

    now i have a cute little book icon next to the read more text (which includes the title of the post) I always forget how easy it is to use the period concatenate in php.

    Thanks!

  4. bongkph
    Member
    Posted 7 years ago #

    This one is veryuseful. But how can I make the tag to be right after the last word and not under it. Currently I have it layout as follows:

    Jack and Jill went up the hill, To fetch a pail of water; Jack fell down, and broke his crown, And Jill came tumbling after.
    <Read the rest of this post>

    --I want it to be llike this--
    Jack and Jill went up the hill, To fetch a pail of water; Jack fell down, and broke his crown, And Jill came tumbling after. <Read the rest of this post>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags