Snippets

0

A favicon is a little 16×16 pixel image that appears in your browser tab to the left of the web page description (or if using IE or safari, it appears to the left of the webpage url in the address bar). If you are unsure where this code should be placed, just do a quick search on Google, there are plenty of tutorials.

For a normal website, you can insert this snippet somewhere within the head tag:

<link rel="shortcut icon" href="/favicon.ico" />

For a WordPress website you can use the following which needs to be placed somewhere within your opening and closing head tags in the header.php file :

<link rel="shortcut icon" href="<?php bloginfo('stylesheet_directory'); ?><!--File Path-->favicon.ico" />

This will retrieve your favicon from your theme path (or child theme if you’re using that).

*Make sure you specify the file back correctly within the snippet.

0

Introduced in WordPress 2.5, shortcodes are small snippets that you insert into posts and pages that call in certain things.¬†What if you wanted to insert a shortcode into a WordPress template though like index.php? If you write the shortcode directly into the template¬†it won’t work.

So to get a shortcode to render through a WordPress template just insert the short PHP snippet below replacing the “insert shortcode here” with your shortcode.

<?php echo do_shortcode("[insert shortcode here]"); ?>

Free eBook: How to Create a Million Dollar Website

Many people dream of becoming an internet millionaire. Don't be a dreamer download this eBook, join my newsletter and start taking action today.

  • How to Find a Profitable Niche
  • How to Market Products Online
  • How to Build a Profitable Email List
  • How to Beat the Competition
  • Free Weekly Internet Money Making Methods

Free eBook: How to Create a Million Dollar Website

Many people dream of becoming an internet millionaire. Don't be a dreamer download this eBook, join my newsletter and start taking action today.

  • How to Find a Profitable Niche
  • How to Market Products Online
  • How to Build a Profitable Email List
  • How to Beat the Competition
  • Free Weekly Internet Money Making Methods