Select Page

Use Shortcode in WordPress Template with Custom Fields

This PHP allows you to use Shortcode in a WordPress template but also pull in a value from a custom field. This was used to add a shortcode for a slider to a specific page. <?php $slider = get_post_meta($post->ID, 'slider', true); echo...

Use Shortcode in WordPress Template

If you need to run a plugin which uses shortcodes in your template, this can be done with the following code. <?php echo do_shortcode("[shortcode]"); ?>

Add Google Map to WordPress Site

Add the following to the functions.php file <?php function fn_googleMaps($atts, $content = null) { extract(shortcode_atts(array( "width" => '640', "height" => '480', "src" => '' ), $atts)); return ''; }...