Modify wp_query for a specific category in category.php

Suppose you have a category called “events“, with a custom field with the date of the event, which is different from the post date. If you want to order the loop based on that field, only for that “events” category, you can do as follow. Place it in category.php, at the beginning (or before the […]

Custom get_avatar function for WordPress

This is the raw version of a function that picks the avatar of a user in a specific directory instead of the Gravatar image. A nice feature of this custom get avatar function is that if the file in the directory doesn’t exist for the user, it returns the normal Gravatar WordPress output, so you […]

Clean up and optimize WordPress head tag

If you need to know how to remove RSS Feed URL’s from page head or how to remove post relational links from wp_head read this article! The way to modify the content in head tag is to use remove_action function and add_filter function to hook the original WordPress functions and modify the html. You have […]

Optimize WordPress, a long list of tips

In the above image you can see your WordPress before reading this post, and after the optimizations you will make after you read it. :) This article contains a lot of suggests to optimize your WordPress installation and make your site faster and better. Add cache to make WordPress faster The really important help for […]

Remove archive pages in WordPress, how to

I think that in most blogs (that is not all) archive pages are redundant content and there’s no need to make these pages available. So I’ve found a method to remove archive pages from WordPress without any plugin but with just a few lines of PHP code. To remove archive pages in WordPress to prevent […]