WordPress.org

Ready to get started?Download WordPress

Forums

Titles on posts appearing with HTML code rather than as normal (3 posts)

  1. LucasClarkel
    Member
    Posted 2 years ago #

    I am over at thesimplegamers.com and at moment randoms posts have the link code appearing rather than the link itself. Its only happened to 3 posts out of all of them so far but I have not yet found a solid solution for it.

    Has anyone seen this before?

  2. alchymyth
    Forum Moderator
    Posted 2 years ago #

    your theme seems to be using a plugin or build-in code to mark (multiple) capital letters;

    which seems to mess with the title attribute of the post title link:

    <h2><a title="If you like that shit, put a <span class="caps">LEGO</span> on it." href="http://thesimplegamers.com/putalegoonit/" rel="bookmark">If you like that shit, put a <span class="caps">LEGO</span> on it.</a></h2>

    also, the theme is not using the_title_attribute() in the linked post title (in index.php inside the loop).

    index.php (from the theme - wrong code):

    <h2><a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>

    change that to:

    <h2><a title="<?php the_title_attribute(); ?>" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>

    http://codex.wordpress.org/Function_Reference/the_title_attribute

  3. LucasClarkel
    Member
    Posted 2 years ago #

    That appears to have fixed it all. Thanks for that :D

    Now everything doesn't look stupid :D

Topic Closed

This topic has been closed to new replies.

About this Topic