Insert the post title in your “read more” tag easily

Watching twitter today, i came across a tweet from Kikolani. Now i’ve been following her for quite some time getting valuable feedback and post ideas. Today’s tweet was about a post on TechJaws called “The Biggest Mistakes in SEO” which i found interesting. As always i have my agrees and disagrees but still it was a nice read. One of the author’s points was ““Click Here” or “Read More” Link Anchor Text“. Here is what he suggests:

Many people use “Clíck here” or “Learn more” as the linking text. This is great if you want to be ranked high for “Click Here”. [...] It’s much more descriptive (and relevant) to say “learn more about {keyword topic}”

I see the point on this and i agree. Besides, the info has already been retrieved from the database so no more extra load is going down. It’s not only SEO friendly, it’s reader friendly as well. That’s what’s most important. On the comments, Kikolani said she hadn’t figured out how to do it. I thought that many non techy people out there might find it hard, as well. So, here is how i did it! (notice it on the read more following)

What you need to tinker with is your index.php or home.php file in your running theme folder. In there, you will find a call to the function “the_content()“. This function takes as a parameter the text we want to display as the read more. If no parameter is passed the following is printed out “(more…)“. You need to change that one to this:

  1. the_content(‘Read more on "’.the_title(, , false).‘"’)

What we have done here is that we have used the template tag “the_title()” which actually displays the post title. You must have noticed that we have passed a few parameters in. This happens because the default behavior of the function is to print out the title rather than return it, which we need here (that’s what the false does). The first and second parameters are a before and after text. This means that if you wanted to make the title bold, you could pass as the first parameter “<b>” and as the second “</b>“. If you lost me then you just have to trust me!

All in all i think it’s an easy fix. As always i am here for any problems or help you might need.



18 Responses to “ “Insert the post title in your “read more” tag easily”

  1. Good Tip Strato. Even i used to link with the Read More option. Never thought about this.

  2. stratosg says:

    @Madhur: I wouldn’t like to steal credit from Frank over at TechJaws. The idea is his, the small tip on the implementation is what i suggested here. Thanks for dropping by!

  3. Kikolani says:

    I had too much on my mind yesterday to figure out how to do this, but seeing your post today reminded me that I need to get on this. So now it’s fixed to say Read more the_title.

    And thanks for following me! I’m glad I’m providing useful info. :)

    ~ Kristi

  4. Ching Ya says:

    Looks like a useful tip for some bloggers. Tweeted this and thank you for sharing. I do, personally love the feature of ‘Read More’. Use it occassionally for some of my lengthy posts, always a fan. ^^

    @wchingya
    social media/blogging

  5. stratosg says:

    @Kristi: Nice to see it done ;)

    @Ching Ya: Thanks for dropping by…!

  6. Codesucker says:

    Kudos – I’ve always told people they are losing relevancy points for displaying the ‘read more’ links. I’m old school and will display the entire text from my last 10 posts on my homepage – I don’t recommend this, it will destroy your load time and decrease the relevancy of your homepage to the backlinks that juice it.

    This is the perfect seo-concious solution. Great job, you’ve earned yourself another reader!

  7. stratosg says:

    @Codesucker: Thanks for dropping by and reading. As i said the SEO part goes to Frank at TechJaws. But again, thanks for being here!

  8. Paul says:

    I wonder if that really does anything for SEO or not. It may not make any difference.

  9. stratosg says:

    @Paul: I am not sure but it’s reader friendly, as i said, and i think it’s nice to have it…

  10. Hi,

    What a great tip. It looks like it would be an easy one to implement. Thank you for sharing.

  11. stratosg says:

    @Barbara: Thanks for dropping by and i hope it turns out to be useful to you!

  12. Hi Stratos – I don’t suppose this would work with the_excerpt ? I don’t think it takes any parameters but I like to use that in some instances more than the the_content.

    Great tutorial though!

  13. stratosg says:

    @Kim: From the documentation of it http://codex.wordpress.org/Template_Tags/the_excerpt it won’t show anything more than a “[...]“. So, i guess it won’t work that way… You can always do the call to the_excerpt and then add a custom link…

  14. Nihar says:

    Great tip.

    I immediately opened index.php and modified the_content.

    Thanks agian.

  15. Natural says:

    ah ha! great tip. i used to use the read more feature on my blog but i don’t anymore. i guess people got tired of clicking read more and maybe some wouldn’t bother. i think i like being able to see the entire post w/o having to click anything else.

    anyhoo, i LOVE you website setup, complete with your blog, photos and other extras. nice work.

  16. stratosg says:

    @Natural: Well i use the read more tag because i think that having a “clean” and not so long home page is important for someone to scroll down when he first visits and takes a look. My posts are techy most of the time so that would bloat up my homepage.
    Also thanks for dropping by. I really appreciate it…

  17. Pretty simple. I had my brother do it for me every time I needed. I didn’t realise it was so simple. Thanks.

  18. Thanks for the Tip stratos, I need to see how I can make this changes in My Thesis theme.

Leave a Reply