Tag: php

WordPress Maintenance Page

If you’ve updated WordPress, you should have noticed that wordpress goes into “maintenance mode” whenever mass plugins or WordPress itself is updated.  What if you wanted to do some manual upgrading?  Then you can manually put wordpress into maintenance mode.

Tagged with: ,

WordPress Cron

A great way to take more control of your wp-cron and also slightly speed up wordpress is to disable cron and scheduled a cron job on your server to run wp-cron.php.  You just need a server that supports cron jobs.

Tagged with: , , ,

Hardening WordPress

I’ll be updating this post as I find more and better explanations to hardening wordpress.  The more secure, the better.  Some things to keep in mind when you are trying to secure your wordpress installation. Be careful when saying a

Tagged with: , ,

How to use your own template for specific times

There’s a great post on how to get WordPress to use your own template and override the default template. The basic code looks like this; function my_template() { if (is_category() && get_query_var(‘cat’) == get_cat_id(‘fun’)) { include (TEMPLATEPATH . ‘/category-fun.php’); exit;

Tagged with: ,

WP Query inconsistencies in query

Problem In WordPress, I created a new WP_Query with a few simple args to get a custom post type.  However, no results came back.  I could look at the query by checking WP_Query’s request property.  The query, when run in mysql

Tagged with: ,

Optimize Custom WordPress Queries

A couple things that may optimize your custom wordpress queries.  First there is a parameter called ‘fields’ where  you can specify that you only want the ID field back.  Something like below: $some_query = new WP_Query( array( ‘fields’ => ‘ids’

Tagged with: , ,

Buddypress User Ids

Buddypress has several methods to get the user ids.  This post attempts to clarify the differences between these: bp_current_user_id – Exactly the same as bp_displayed_user_id.  This is possibly an old, now renamed, method. bp_loggedin_user_id – The buddypress logged in user id.

Tagged with: , ,

WordPress – Change Post Counts on edit.php

Problem I wanted to change what posts were displayed to a user when they logged into wordpress and view the Posts page  I could easily alter what posts are shown by using the ‘pre_get_posts’ filter, but the problem was that

Tagged with: ,

Caching With Widgets

W3 Total Cache is a great WordPress plugin that will help your Google Page Speed score and will also speed up your website.  The only problem is that it doesn’t clear the cache when widgets are updated.  So for example

Tagged with: , , , ,

Custom Post Type Templates in Plugins

Problem I made a plugin that created a custom post type, but the only way I could customize the single-customposttype.php and archive-customposttype.php is by placing the files into the theme.  It would be nice if everythere could be contained in

Tagged with: ,
Top