Advertisements
Tag Archives: caching

Cache posts in category/tag/taxonomy for better performing content blocks

If you ever needed to grab a bunch of posts from different categories or taxonomies into your theme to fill certain layout blocks with their respective content you’d likely ended up doing a bunch of WP_Query calls with the desired parameters. That’s all nice and works ok, but it causes some additional database queries for […]

Continue reading

Caching WordPress navigation menus – wp_nav_menu() wrapper

Navigation menus in WordPress are a great thing, sadly they are usually not performing very well and you might want to cache them. Here’s a small set of functions that allow you to cache the output of the navigation menus. Please note the inline comments in case your navigation menus have different layouts depending on […]

Continue reading

Caching get_posts()

get_posts() is a nice little function and is widely used within themes and plugins, but what most people don’t keep in mind is that there is at least one database query behind each of the calls. With taxonomy,category or meta queries it’s even more, so caching the result of this function can have quite an […]

Continue reading