Don’t want a huge plugin to restrict a single WordPress user to a single page? Either did I, so I wrote this: Where $restricted_user is the ID of the restricted user and $permitted is the ID of the only page the restricted user can access/edit.
Like rings on the tree, older WordPress website often have a ton of media thumbnails from older themes and older plugins/settings. To delete this bloat, I’ve created a simple plugin to find and delete all thumbnails from your Media Library. Download > » WordPress.org Plugins: Delete Thumbnails Description Use this plugin to delete ALL thumbnails … continue reading »
Database getting a little fat? Burn that extra lagging fat instantly by clearing out old revisions via MySQL If you don’t have access to phpMyAdmin or can’t get into ssh mysql, throw it in your functions.php file If you want to disable revisions altogether, add the following to wp-config.php
There may be a variety of reasons for having to do this, despite how daunting it may seem, it’s actually not that big of a deal. If we want to change oldnetworkname.com to newname.com on a domain mapped WordPress Network, we just have to modify a few settings in WordPress, all records manually in the … continue reading »
Trying to upgrade All-in-One Event Calendar, I’d continually get a You do not have sufficient permissions to access this page. error after the theme installation. The problem has nothing to do with permissions – it has to do with the /wp-content/themes-ai1ec/ folder likely being empty. If it is empty, copy the four sub folders from /wp-content/plugins/all-in-one-event-calendar/themes-ai1ec/ … continue reading »
I’ve never liked the wp_head() output – WordPress’s default output is great for blogs and accessibility but if you’re a developer whose source-code is basically your resume, you don’t want irrelevant and un-indented code leaving skid marks behind the scenes. Throwing this in functions.php will remove most of it.
Nothings worse then getting an email about someone being unable to upload a 6mb .PDF because it “exceeds the upload file size limit” Here’s the fix – but important note: raising postmaxsize increases the possibility of DoS attacks on your server: In functions.php add: If that doesn’t work, it could be a apache restriction, in .htaccess … continue reading »
If you have any experience with wpgetattachmentthumburl() you’ll know it’s really slow.. It’s a maze trying to figure out why, it just seems to require querying a lot of meta data. So, to simplify WP’s queries I wrote this function to grab a thumbnail from the image’s full URL: Then just get my thumbnail with … continue reading »
I had a WordPress installation in /blog/, but I needed a WordPress’s GravityForm to render /contact.php an external non-WordPress php page. I could of coded a form myself, but there are so many advantages to using GravityForms. in contact.php in a perfect world, the following would work: but it doesn’t — upon submission the page reloads with … continue reading »
Here’s a good way to find out how many and what queries are being executed and how long it takes. Your code may be inefficient and here’s a good way to tell. When troubleshooting I’ve used adminfooter hook so this will show in the admin, you can use wpfooter or other late hooks to show … continue reading »
WordPress makes it super simple to run cronjobs.. To add one, just place the following code in your functions.php file and change the function/action prefix’s to your relevant plugin name/functions. A little break down for those unfamiliar: the first action runs mypluginschedulecron() on each load. If your cronjob (myplugincronjob) is not registered, it‘s scheduled into … continue reading »