Code Snippet: Display latest Post per Category

A while ago a client wanted to display the latest post per category on the WordPress blog page. The goal was to respect sticky posts and therefore exclude the category used by the latest sticky post. WordPress offers the pre_get_posts action hook to alter the WP_Query instance before it runs the query on the database. …

Read moreCode Snippet: Display latest Post per Category

Code Snippet: WordPress Page Template Redirect to child page

Sometimes you need a simple way to redirect a parent page directly to it’s first child page in WordPress. This little snippet is a WordPress page template to be used in your theme. It includes support for WPML, in case you still use my least favorite translation plugin in the universe. I strongly suggest you …

Read moreCode Snippet: WordPress Page Template Redirect to child page