Select Page

How to use the page class feature in Joomla

This code can be used to target pages based on the page class property in the Menu area. <?php $app = JFactory::getApplication('site'); $params = & $app->getParams('com_content'); $pageclass = $params->get('pageclass_sfx'); ?> class="<?php echo...

Email Cloaking for Joomla

Simple Joomla code to cloak an email address. $email = 'email@domain.com'; $cloaked = JHTML::_('Email.cloak',$email); echo $cloaked;

Set WordPress custom menu per page/post using a custom field

Add this to your template where you want the menu to appear <?php $menu_slug = get_post_meta($post->ID,'menu',true); if(is_nav_menu($menu_slug)) { wp_nav_menu(array( 'menu' => $menu_slug )); } ?> Within each post or page add the custom field menu and set...

Show Related Posts Without A Plugin

Add the following code to your single.php. <?php $tags = wp_get_post_tags($post->ID); if ($tags) { $tag_ids = array(); foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id; $args=array( 'tag__in' => $tag_ids, 'post__not_in' =>...