WordPress

New Plugin: Code Prettify (Syntax Highlighter)

Most syntax highlighters use either shortcodes or make you add some obscure CSS classes to all <pre> tags that you want to highlight. Even WordPress.com does that.

Introducing Code Prettify Syntax Highlighting Plugin

Code Prettify for WordPress is a new plugin with just 31 line of code that enqueues the Google Code Prettify library (one minified javascript file) which then parses all <pre> tags on the page, detects the correct language and lazy-loads the necessary syntax module, and applies the highlighting.

Code Prettify (Syntax Highlighter) WordPress Plugin

No shortcodes, no custom CSS classes — just magic.

Disable Title Rewrite in WordPress SEO

Here are two simple filters to remove the rewrite of <title> content functionality provided by WordPress SEO:

// Remove the wp_title filter
add_action( 'init', 'remove_wpseo_title_rewrite' );

function remove_wpseo_title_rewrite() {
        global $wpseo_front;

	remove_filter( 'wp_title', array( $wpseo_front, 'title' ), 15 );
}

// Remove the title metabox from backend UI
add_filter( 'init', 'remove_wpseo_title_rewrite_metabox' );

function remove_wpseo_title_rewrite_metabox( $metaboxes ) {
	if ( isset( $metaboxes['title'] ) )
		unset( $metaboxes['title'] );

	return $metaboxes;
}

Interview with Dougal Campbell

It was in these early days that I first heard of this CGI script called PHP/FI. At this time, “PHP” stood for “Personal Home Pages” — it was only later that it was renamed to mean “PHP Hypertext Processor”. One of my first experiments was to use PHP and MySQL to create a database-driven news site for our customers, which I loosely modeled after Slashdot. It was my first blog-like system, pulling articles from the database newest-first, and displaying them ten-per-page. I didn’t even bother to make an article editing system, I just used PHPMyAdmin to add new entries to the database.

via Dougal Campbell Interview

FeedBurner and WordPress

While adding new blogs to WP Roll I noticed that a lot of them still redirect their RSS feeds to FeedBurner. I guess it’s because of subscriber stats, email delivery and other little features that FeedBurner provides.

However, like others I have a strong feeling that FeedBurner will be the next product that Google shuts down. Luckily, FeedBurner offers 30-day feed redirection option, if you decide to remove the feed from FeedBurner:

FeedBurner redirect feed after removing

So go ahead and claim back your short and awesome feed URL that WordPress provides by default.

Automatic Theme Fallbacks for Post Formats in WordPress 3.6

WordPress 3.6 adding post format content to main content automatically

Today I noticed that WordPress (3.6-alpha-23883) has started automatically adding content to my posts that use post format other than the standard “post” and have some of the new meta fields filled out. Then I found this ticket #23347 which along with the attached patches explained everything — posts of the following post format: link, image, quote, video and audio will have post_formats_compat applied to the_content filter in wp-includes/default-filters.php, which means that all themes that don’t explicitly define

add_theme_support( 'structured-post-formats', array( 'link', 'image', 'etc...' ) )

will have that meta information prepended or appended automatically to post content.

Solution

Simply remove post_formats_compat from the_content filter, like so:

remove_filter( 'the_content', 'post_formats_compat', 7 );

or mark your theme as being aware of that new post format meta:

add_theme_support( 'structured-post-formats', array( 'link', 'image', 'quote', 'video', 'audio' ) );

Page 1 of 17