Weekend WordPress Tweaking

Weekend WordPress Tweaking

Finally added “Asides” this weekend, which will allow me to post quick notes on the main page without muddling up the RSS feeds. I’m hoping this will encourage me to post when I’m too busy to write a full article. Eventually I’ll move the asides into their own sidebar, but that will have to wait until I do a full redesign.

Boring technical notes follow.

I followed the instructions at The WordPress Codex, which are based on Matt Mullenweg’s original hack. This is the first time I’ve actually modified my WordPress loop with conditional post formatting, so that was an informative experience.

To arrange it so that the RSS feeds didn’t get polluted with these tiny posts, I followed Phu Ly’s directions. So theoretically, neither Feedburner nor 9rules automatic content snagging will be affected. One thing that I screwed up at first was assigning multiple categories to the Aside post (like Aside, Tricks) which caused the post to show up in the feed after all. Oop.

I had one snag getting my Markdown-formatted content to appear correctly. I wanted it all to appear in a nice compact single-paragraph block. However, I wanted to use the Markdown-style hyperlink notation. The default way that the “Mullenweg method” uses is this:

    echo wptexturize($post->post_content);

…which echoes the unfiltered contents of the post and exposes all the raw Markdown formatting. SO I tried:

    the_content();

…instead, but this inserts extra paragraph tags and thus inserts extra linefeeds and space. I finally did the following:

    if (function_exists('Markdown'))
        echo strip_tags(Markdown($post->post_content),'<a>');
    else the_content();

This calls the Markdown filter directly, assuming the filter exists. The resulting text is then stripped of all tags except for the listed tags. If the Markdown filter doesn’t exist, it just runs things through the_content() and I accept the unpleasantness of the extra linefeeds. I suppose I could just echo the post_content in that case instead of running it through the_content().

UPDATES

  • I added some AdSense code for QuickPosts that should only be visible if you click all the way down into the permalink. What I’m wondering is whether these quickposts will be indexed by search engines and draw clicky traffic. Regular readers shouldn’t see them at all. I assigned a different AdSense channel to these ads to try to track this activity.

  • I burned a QuickPosts feed through Feedburner, and have added that to the Feeds section of the sidebar. Also tossed out some older subscription link options.

  • I redirected https://davidseah.com/syndicated and https://davidseah.com/syndicated/quickposts to the feedburner feeds through my .htaccess file.

5 Comments

  1. Dave Seah 55 years ago

    I’ll probably set up a separate feed for these. So far I’m liking the idea. Also, they force me to be brief, which is a good thing! :-)

  2. Phu 19 years ago

    Just to be pedantic, my name is Phu (i.e. sounds like Foo) not Phy:)

  3. Dave Seah 19 years ago

    heh, you’d think I’d be more sensitive to spelling like that :-) corrected!

  4. peninah 19 years ago

    :) awesome. I like, except I’m trying to curtail my web surfing by only reading in rss readers.. When I can focus enough I’ll attempt it.

  5. peninah 19 years ago

    thanks?! :)