Select Page

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...

WordPress if page exists code

Use this to target code if a certain page exists, useful to show gallery images in a sidebar if there is a gallery page. <?php if(get_page_by_title('Gallery')) : {code here} endif; ?>