Tag Archives: Wordpress

A New Plugin – Plugin’s Last Updated Column

So Karissa asked me at WordPressKc’s Meetup group if I knew of a plugin that would show when plugins were last updated on the admin plugin’s page.  Right now you’d have to search up the plugin on wordpress.org to find this information.  I didn’t know of a plugin with this functionality, so Karissa suggested that would be a good idea for a plugin.  I told her I would look into this when I get some time.

I finally had some time yesterday to sit down and figure this out.  3 Hours after I started, it was done.  I’ve submitted this to WordPress.org’s plugin repository.

https://wordpress.org/plugins/plugins-last-updated-column/

More information can be found: http://stevenkohlmeyer.com/plugins-last-updated-column/

WP-Config Disable Cron

define(‘DISABLE_WP_CRON’, true); //Disable page load cron

WordPress › Support » How to disable wp_cron via page loads and run it manually instead?.

WordPress Starter Plugin

Everything you need to write your own plugin. This is the starter solution. It shows how to plugin with your own class to wordpress, already set up custom functions. This is version 1 of this empty plugin. The admin menu (with a submenu), a settings page, another settings page. You can do just about anything your heart desires with wordpress, and plugging into it is pretty easy. Check this out:

WordPress custom menu disappear on home page when using custom post types and/or taxonomies.

Wordpress custom menu disappears on home page.

As you’re developing a theme, you try one of WordPress’s newer options: Custom Post Types.  Searching the internet you stumble upon Justin Tadlock’s blog.  You try his way of showing custom post types on your home page of your wordpress blog.  Then boom. You’re custom menu is not showing on your homepage.  Now what do you do.

I spent about a week going back and forth with my custom taxonomies, and WordPress 3.0’s new custom menu editor trying to figure out why the hell my home page isn’t showing my custom menu.  It shows all on my other pages.

Out of all the code, from all over the internet, that I used.  I had put the following code in my functions.php hoping to show my custom post types.

This code works, unless you’re using a custom menu you’ve made in the back end of wordpress.  This will for whatever reason (to which I have not investigated) make your custom menu’s disappear from your home page faster than a rabbit can crap.  So I’ve spent a whole week investigating my custom taxonomies, and wordpress’s custom menu editor, when the only thing I messed up was using Justin Tadlock’s code.

Here is what you do instead of putting that jargon of a excuse for code into your functions.php:

Pick any of your template files that show your posts or pages: pages, loop, home, index, or whatever single-{taxonomy name}.php you want to edit and add your custom post types to and add the following code above the loop:

or whatever you needs may be:

Happy coding, and careful who’s blog you read 😉 Thanks JustinTadlock I was stuck on that crap for a week.

~Steven Kohlmeyer

WordPress custom Functions.php I need. Thanks digwp.com

Completely remove the version number from pages and feeds

A commonly cited security measure for WordPress-powered sites involves removing the automatically generated version number from appearing in the section of your pages’ source code. This type of security technique is referred to as “security through obscurity,” and aims at hiding potentially sensitive information from a would-be attacker. Here’s a function that does the job:

// remove version info from head and feeds
function complete_version_removal() {
return ”;
}
add_filter(‘the_generator’, ‘complete_version_removal’);
This will remove your site’s version and generator information from all of your pages and feeds, making it a little bit harder for the bad guys and a little bit safer for you and your visitors.

Delay feed update after posting

As a chronic perfectionist, I hate it when I post something only to discover an error a few minutes later. By the time I notice, fix and update the post, it’s already been beamed out all over the freakin’ place. To prevent this, I like to take the advice of WPEngineer and give myself a little buffer period or “safety net” after publishing my posts.

// delay feed update
function publish_later_on_feed($where) {
global $wpdb;

if (is_feed()) {
// timestamp in WP-format
$now = gmdate(‘Y-m-d H:i:s’);

// value for wait; + device
$wait = ‘5’; // integer

// http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_timestampdiff
$device = ‘MINUTE’; // MINUTE, HOUR, DAY, WEEK, MONTH, YEAR

// add SQL-sytax to default $where
$where .= ” AND TIMESTAMPDIFF($device, $wpdb->posts.post_date_gmt, ‘$now’) > $wait “;
}
return $where;
}
add_filter(‘posts_where’, ‘publish_later_on_feed’);
This code quietly and automatically gives me an extra five minutes before my post is added to my feeds. If you need more or less than five minutes, just edit the “$wait” variable with the integer of your choice.

Add an Admin link to the WordPress “All-Settings” page

As we’ve explained before, WordPress makes it easy to view and edit your blog settings from the Admin area. Thanks to a file named “options.php”, WordPress will display all of your database settings and enable you to edit a majority of them. To view this page, you need to log in as Admin and enter this URL in your browser’s address bar:

http://domain.tld/wp-admin/options.php

Having access to your “All-Settings” page can be extremely helpful, so it’s nice to display a direct link for easy access. The following slice of code in your functions.php file is all that’s needed:

// admin link for all settings
function all_settings_link() {
add_options_page(__(‘All Settings’), __(‘All Settings’), ‘administrator’, ‘options.php’);
}
add_action(‘admin_menu’, ‘all_settings_link’);
Once in place, you will see a link to your “All Settings” page in the WordPress Admin. You can change the name of the link to whatever you prefer by editing the two instances of “All Settings”.

Thanks for the great code DigWP.com
http://digwp.com/2010/04/wordpress-custom-functions-php-template-part-2/

Related Posts

Moving / Backing Up a WordPress Database

Changing or moving your database is pretty easy.  I suggest using Navicat MySQL for database backing up and moving.

With Navicat it becomes extremely easy to move a database.
First thing you do, is set up your database connections in the software.
Then you open your database you want to move or backup.
Navicat Databases / Tables view

Next Select Backups from which database you’re moving or backing up.

Navicat MySQL Backups View

Click Backup

Navicat MySQL Backup Dialog

Now click Start.  You don’t have to set anything by default, it will just make a new backup.

Navicat MySQL Backup Complete

This is how you create backups.  Moving from one database to another is very easy as well. Open your backups from the tree view.  Right Click on the backup you want to copy to another database and COPY.

Navicat MySQL Copy Backup

Now find the database you want to put the backup in.  Go to it’s backups.  And Paste the backup into the other databases backups section.

Now open that database backup, and restore it.  As long as the database your moving too doesn’t already have the same tables, you shouldn’t have a problem.

Related Posts