Warning, High Geek Quotient: Wordpress Fixes

by Alastair McDermott · 3 comments

Warning: High Geek Quotient, Proceed With Caution.

Here’s a couple of tips to fix some Wordpress issues that the Wordpress development team says are Working As Intend. This post is not for non-techies.

First we have A Wordpress Hack To Use The More Tag And Still Show Full Posts In Your RSS Feeds.

Dave recently rolled out his latest redesign on his Search Engine Marketing Blog. Cormac and I noticed he wasn’t displaying full feeds in the RSS feed any more.

This is because the Wordpress developers believe that if you use the <!– more –> to show partial posts on your blog homepage, obviously you want to show partial posts on your RSS feed. This is a Bad Thing and will royally piss off your RSS subscribers, particularly those reading feeds on handheld devices.

So what to do about it? Well, you can grab a plugin to fix this here. Or, you can delve into wp-includes/post-template.php in your Wordpress directory :-)

Here’s the code you’re looking for. Replace

if ( preg_match('/<!--more(.+?)?-->/', $content, $matches) ) {

with

if ( !is_feed() && preg_match('/<!--more(.+?)?-->/', $content, $matches) ) {

This fix simple prevents the reg match running if it’s a feed.

You can make this simple change every time you upgrade Wordpress and you won’t need to install any plugins etc. Ok, I promised you another fix.

This one is A Wordpress Hack To Stop The More Tag Breaking Your Digg Button.

Yeah, that pesky <!– more –> tag again! Leo over at ZenHabits (another really great site) had a problem where the more tag was breaking the Digg button because it was inserting #more-$id on the end of his permalinks. Y’know, I’ve always disliked how the Read More link isn’t to the top of the page, so let’s just get rid of that anchor completely…

This is again in the wp-includes/post-template.php in your Wordpress directory. Replace this line:


$output .= ' <a href="'. get_permalink() . "#more-$id\" class=\"more-link\">$more_link_text</a>";

with

$output .= ' <a href="'. get_permalink() . "\" class=\"more-link\">$more_link_text</a>";

Ok, that’s all for now. Please leave a comment with feedback, particularly if you found it useful. Cheers :-)

Share this post
  • Add to Delicious
  • Add to Digg
  • Add to Reddit
  • Add to StumbleUpon
  • Add to Technorati
  • Add to Sphinn
  • Add to Google Bookmarks

{ 3 comments… read them below or add one }

Dave Davis September 15, 2007 at 5:34 pm

Hey Al,
We finally got it working. We had the added complication of limiting the amount of text on the main blog page as well as not showing images on the main blog page.

We used a different method to what you posted.

IM me if you want details on how it was done.
Thanks again for all your help.

Ventrilo Servers September 17, 2007 at 6:48 pm

Thanks for the tips man

Rebecca October 2, 2007 at 1:52 pm

Wow, these tips are great! Thanks!

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post:

Next post:

01 440 4342

About

WebsiteDoctor is consultancy and training business focused on internet marketing, particularly search engine optimisation. We are experts in all aspects of online marketing and websites. We can help your businesses increase sales and profitablity by reaching more customers through internet marketing. We can help you save money through increased knowledge of online technologies. Are you looking to upskill and become more valuable on the job marketplace? Sign up for one of our online marketing training courses like search engine optimisation or social media marketing!

Our RSS Feeds

We value your privacy.