HOWTO: [Fix, hack, WordPress theme, jQuery, URLs] Fix Nirvana theme “Continue reading” links error in homepage

Yesterday a friend of mine, Luigi* pointed me an error in this website homepage: all excerpts automatically built by (the great) Nirvana Theme (by Cryout Creations) were linked to the first article.
Hadn't noticed it before, my apologies and thanx to my friend, really.

So I managed to find a solution, but... now I'm on a day off and tomorrow I probably will not have time to fix it hacking the theme/plugin code so I tried a different and simpler solution with jQuery.

With this simple line I grab the first (correct) link and substitute it to the wrong one, for each element in the list.

jQuery('.entry-summary a').each(function() { jQuery(this).siblings('p').children('a').attr('href', jQuery(this).attr('href')) });

... that means:

for every link inside a div  marked with "entry-summary" class
go to the sibling element that is a paragraph
that contains an anchor tag
and substitute its href attribute
with actual link

... yes, I know, this is a spaghetti-code solution, but I hope that future Nirvana updates will fix it ASAP.

HIH

* great guy, thaiboxer and programmer with whom I shared numerous sparring sessions and interesting IT conversations 😉

You may also like

Comments are closed.