Add Clickable Icon Linked With Post Title

The code snippets in this tutorial enable you to add a icon before or after the entry title on any archive pages and single posts/pages.

icon-before-title

In this case, the icons used are dashicons which are already registered in WordPress by default so you only need to load them using the following code in your functions file:

add_action( 'wp_enqueue_scripts', 'load_dashicons' );
function load_dashicons() {
    wp_enqueue_style( 'dashicons' );	
}

Check your child themes functions file first because your theme may already load dashicons meaning you won’t need to add the above code.

Once you’ve loaded the icons, you can then add them to your entry titles using a variety of methods.

You can either:

  1. Add the same icon to all entry titles or
  2. Add a unique icon to every entry title

The code for all solutions is included for members below:

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.