StarComp Technology Blog

0

WordPress Function to Load jQuery from the Google CDN

Tested on: WordPress 3.0.1 // even more smart jquery inclusion 🙂 add_action( ‘init’, ‘jquery_register’ ); // register from google and for footer function jquery_register() { if ( !is_admin() ) { wp_deregister_script( ‘jquery’ ); wp_register_script(...

1

WordPress Function to Include custom post types in the search results

Include custom post types in the search results. // MAKE CUSTOM POST TYPES SEARCHABLE function searchAll( $query ) { if ( $query->is_search ) { $query->set( ‘post_type’, array( ‘site’, ‘plugin’, ‘theme’, ‘person’ )); } return...

0

WordPress Function to WordPress Profiling tools

WordPress Profiling tools I like to add profiling tools in a separate file, which I then include from functions.php when needed: <?php if ( !defined(‘SAVEQUERIES’) && isset($_GET[‘debug’]) && $_GET[‘debug’] == ‘sql’ ) define(‘SAVEQUERIES’, true);...

0

WordPress Function to Remove Default WordPress Meta Boxes

Remove Default WordPress Meta Boxes Tested on: WordPress 3.0.1 This code will allow you to remove specific Meta Boxes which wordpress adds by default to the default Add/Edit Post and Add/Edit Page screens. //...

0

WordPress Function to Remove “WordPress” to “WordPress” filter

Remove “WordPress” to “WordPress” filter Tested on: WordPress 3.0.1 There was a filter added with WordPress version 3.0 that automatically converts all instances of “WordPress” (no capital P) to “WordPress” (with a capital P)...

0

WordPress Function to Add Custom User Profile Fields

Add Custom User Profile Fields Place the code below into your functions.php file to add custom user profile fields. Edit or add lines as you see fit. Remember not to remove the line: return...

0

WordPress Function to Customize the order of the admin menu

Customize the order of the admin menu tested on: WordPress 3.0.1 This code will allow you to reorganize the order of elements in the admin menu. All that you need to do is click...

0

WordPress Function to Customize the Dashboard

Customize the Dashboard add_action(‘wp_dashboard_setup’, ‘my_custom_dashboard_widgets’); function my_custom_dashboard_widgets() { global $wp_meta_boxes; Remove these dashboard widgets… unset($wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_plugins’]); unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_primary’]); unset($wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_secondary’]); Add a custom widget called ‘Help and Support’ wp_add_dashboard_widget(‘custom_help_widget’, ‘Help and Support’, ‘custom_dashboard_help’); } This is the...

0

WordPress Function to Add Thumbnails in Manage Posts/Pages List

Add Thumbnails in Manage Posts/Pages List You can add this to your functions to display to the Manage/Edit Post and Pages List a new column with the thumbnail preview. /****** Add Thumbnails in Manage...