Subscribe to RSS

Bobbles WordPress Theme Similiar Topics Bug Fix

As you may or may not know, I recently switched to the Bobbles WordPress Theme from Dezzain.com. It truly is a gorgeous theme and has a very “Web 2.0″ feel to it with a lot of social web integration. In using and exploring Bobbles I came across a bug that I informed the creator of, but I decided to take matters into my own hands and come up with a fix.

The bug is small but nevertheless needed to get fixed. If you were looking at a single post — therefore in the single.php file of the theme — you would see a “Similiar Topics” section with related entries to what you were looking at, but when hovering the mouse over a link you would get the_excerpt() from the current post you were reading. So the solution was to change the code to pull the_excerpt() that corresponds to the title of the related post.

After a few hours of hacking away at it here is the code (in single.php) that I changed to get it working:

Bobbles WordPress Theme Single Post Anchor Title Fix

Essentially there are three things that need to be done: 1) add the getWords() function between lines 52 and 61 — make sure it’s not inside the foreach loop or else you will get errors as you can only declare a function once; 2) add the variables between lines 63 and 65 — these will go inside the foreach loop because they need to get done for every related post; and 3) change the value of the anchor tag title attribute in accordance with line 67 so that it outputs the final variable $a_title.

If you want to show more than the first 15 words change the number on line 64 to however many words you want to show, and if you don’t want show the three dots (…) after the excerpt just take out . “…” from line 65.

Let me know if you have any questions or experience any problems.

5 Comments

  1. Posted May 19, 2007 at 4:45 pm | Permalink

    So simple! Why didn’t I think of that?

  2. Posted May 20, 2007 at 7:20 pm | Permalink

    clearly you could have done this in half the time…

  3. LeOgAhEr
    Posted June 20, 2007 at 9:11 pm | Permalink

    I Love you girls

    Buy

  4. Posted August 4, 2008 at 8:26 pm | Permalink

    Your fix renders my single.php as blank when I replace the code as described on this post. The author’s site also says that your fix has been incorporated into an updated download for the theme, and it has not. The original problem with Related Posts still exists. Please advise.

  5. admin_papa
    Posted August 29, 2008 at 2:41 pm | Permalink

    Hello Everybody

    Just wanted to share my new experience.

    If your Windows XP fails to run due to an error related to lost HAL.DLL, invalid Boot.ini or any other critical system boot files you can repair this by using the XP installation CD. Just boot from your XP Setup CD and enter the Recovery Console. Then launch “attrib -H -R -S” on the C:\Boot.ini file and remove it. Run “Bootcfg /Rebuild” and then Fixboot

    Regards,
    Carl

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*