How to

How to Customize WordPress Tag Cloud Widget

Display All Tags

The number of Tag Cloud widget tags are limited to 45 by default. Default format of the cloud display is flat. To set number to unlimited and format to list:

function set_tag_cloud_args($args) {
	$args = array('number' => 0, 'format' => 'list');
	return $args;

How to Display Text to Only Logged in WordPress Users

Create Shortcode for Logged in Users

function logged_in_only_shortcode($atts, $content = null) {
    if (is_user_logged_in() && !is_null($content) && !is_feed()) {
        return $content;
add_shortcode('logged_in_only', 'logged_in_only_shortcode');

To use this shortcode in your post use the following code.

Create Shortcode for Logged Out Users

function logged_out_only_shortcode($atts, $content = null) {
    if (!is_user_logged_in() && !is_null($content) && !is_feed()) {
        return $content;
add_shortcode('logged_out_only', 'logged_out_only_shortcode');

To use this shortcode in your post use the following code.

User is logged out.

Resource: Display Text To Only Logged In WordPress Users

How to Remove WordPress’ jQuery and Use Google’s CDN Version Instead?

Why Use Google’s CDN?

The three most commonly cited reasons to dequeue WordPress’ bundled version of jQuery in favor of Googles are:

  1. Decreased Latency.
  2. Increased Parallelism.
  3. Better Caching.

Why NOT Use Google’s CDN?

  1. WordPress takes great care to make sure its bundled libraries are fully compatible with other bundled scripts. jQuery is loaded in “no conflict” mode to prevent any potential script collisions over the $ variable in the global namespace.
  2. If you load jQuery 1.9 yourself from Google’s CDN, you’ll miss out on the jQuery Migrate plugin and end up breaking several themes and plugins that depend on these deprecated APIs.
  3. Also, WordPress is taking steps to prevent you from dequeueing jQuery on the back end at all.

Source: Don’t Dequeue WordPress’ jQuery

Then, How to Remove WordPress’ jQuery and Use Google’s CDN Version Instead?

function jquery_cdn() {
   if (!is_admin()) {
      wp_register_script('jquery', '', false, '1.8.3');
add_action('init', 'jquery_cdn');

Comment by Nathan Rice:

This is almost sure to cause warnings if you have WP_DEBUG on. The reason being that wp_register_script should only be called on the wp_enqueue_scripts action hook.

How to load jQuery from Google CDN
Replace default WordPress jQuery script with Google Library

How to Add an Admin Bar Menu Link


Here is an example code how to add Editorial Calendar plugin admin bar menu link:

function add_editorial_calendar_admin_bar_link() {
	global $wp_admin_bar;
	if (!is_super_admin() || !is_admin_bar_showing())
		'id' => 'editorial_calendar_link',
		'title' => __('Editorial Calendar'),
		'href' => __('http://' . strtolower($_SERVER['HTTP_HOST']) . '/wp-admin/edit.php?page=cal'),
	) );
add_action('admin_bar_menu', 'add_editorial_calendar_admin_bar_link', 75);
Scroll to Top