How to Include and Execute Short Codes in Template Code files

Shortcodes will work fine on blog posts, pages and widgets but will fail to execute when used within code areas like template files like index.php, footer.php, header.php etc. To get them working, it is very easy, simply go ahead and use the below format – WordPress will execute the shortcode as expected.

SOURCE:
<?php echo do_shortcode('[YOUR SHORTCODE HERE]'); ?>
EXAMPLE: 
<?php echo do_shortcode('[catlist id=21 numberposts=2)]'); ?> (more…)

Read More

Contact form 7 Not Redirecting to Thank you Page?

A simple two step method and fix for the issue you might be facing because you are using a custom or 3rd party WordPress Theme. The contact form on submission does not redirect to the thank you page you have created. The simple fix is that you need to navigate and edit the funtions.php file of the active theme and add the below lines of code at the very end.

add_action('wpcf7_mail_sent', 'ip_wpcf7_mail_sent');
 function ip_wpcf7_mail_sent($wpcf7)
 {
 $on_sent_ok = $wpcf7->additional_setting('ip_on_sent_ok', false);
if (is_array($on_sent_ok) && count($on_sent_ok) > 0)
 {
 wp_redirect(trim($on_sent_ok[0]));
 exit;
 }
 }

Finally add the below line (replace your domain name) in the advanced settings of the contact form 7 settings at the bottom of the page. (more…)

Read More

Is it Better to Use a Pipe or Dash in Page Titles?

The pipe ( | ), is a search engine operator that tells the search algorithms that the phrases on either side are it are of equal importance.When a string of words in a tag are evaluated, the first word inherits the highest weight, the last word the lowest and the steps are determined by how many words are in the string. The pipe makes the first word after it the same weight as the first word.

A hyphen ( – ) connects the words in a title An underscore ( _ ) separates words in a title, Some experts claim underscores stop engines from reading the entire title. Avoid using the underscore A Comma ( , ) separates phrases but does not restart the weighting process so words following a comma are  not considered important Use “&” vs “and” , the later will only have weight if the user search all  the all the words before and after “and” (more…)

Read More