This plu­g­in breaks post ti­tle links. What gives?

More like­ly than not, your Word­Press theme is us­ing an im­prop­er func­tion to set the ti­tle at­tribute of your heading’s link. It is prob­a­bly us­ing the the_title() func­tion, which de­liv­ers the post ti­tle af­ter fil­ter­ing. It should be us­ing the_title_attribute() which de­liv­ers the post ti­tle be­fore fil­ter­ing. Change out this func­tion through­out your theme when it is used in­side of an HTML tag, and the prob­lem should go away.

Here are some spe­cif­ic in­struc­tions for fix­ing your theme. Please note that every theme is dif­fer­ent, so mileage may vary.

To ed­it the theme, log in as an ad­min­is­tra­tor and go to: Appearance > Editor. You will typ­i­cal­ly want to ed­it the fol­low­ing files (if they exist):

  • archive.php
  • index.php
  • page.php
  • search.php
  • single.php

In each file, search for the code that looks some­thing like this:

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

Your theme may con­tain some vari­a­tions. For in­stance, the h2 tags may be h1 or h3… We are look­ing specif­i­cal­ly for the part that says title=" … <?php the_title(); ?> … ". It should be changed to:

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

Save the files, and you should be good to go.

If you are un­com­fort­able edit­ing your theme’s code, you may al­ter­na­tive­ly go to the wp-​Typography set­tings page in your ad­min pan­el and add h1 and h2 to the “Do not process the con­tent of these HTML el­e­ments:” field. This will dis­able ty­po­graph­ic pro­cess­ing with­in im­prop­er­ly de­signed page ti­tle links and page titles.


mnd.sc-Admin

More posts

| | Posted in | Comments Off on This plu­g­in breaks post ti­tle links. What gives?
Comments are disabled for this post.