How to add a custom menu
To create custom menus, declare in PHP them use in HTML templates
- // PHP
- // example register a custom menu.
- // note: example of menu display in tf_examples.php
- // turn this on to activate
- //add_action( 'init', 'register_menus' );
- function register_menus() {
- add_theme_support( 'nav-menus' );
- register_nav_menu ('join_menu', __('Join Us Menu'));
- }
// PHP
// example register a custom menu.
// note: example of menu display in tf_examples.php
// turn this on to activate
//add_action( 'init', 'register_menus' );
function register_menus() {
add_theme_support( 'nav-menus' );
register_nav_menu ('join_menu', __('Join Us Menu'));
}to use custom menu in HTML template files:
- <?php
- wp_nav_menu( array(
- 'menu' =>
- 'Join Us Menu',
- 'theme_location' =>
- 'Join Menu Location',
- 'top_menu',
- 'depth' => 3,
- 'container' => false,
- 'menu_class' =>
- 'nav navbar-nav',
- 'walker' => new ashi_services_side_navwalker(),
- 'landing_page' => $landing_page, ) );
- ?>
<?php wp_nav_menu( array( 'menu' => 'Join Us Menu', 'theme_location' => 'Join Menu Location', 'top_menu', 'depth' => 3, 'container' => false, 'menu_class' => 'nav navbar-nav', 'walker' => new ashi_services_side_navwalker(), 'landing_page' => $landing_page, ) ); ?>
it is also possible to specify a custom walker function:
- 'walker' => new ashi_services_side_navwalker(),
'walker' => new ashi_services_side_navwalker(),
it is also possible to specify arbitrary variables that can be picked up in the walker function:
- 'limit_to' => $limit_to,
'limit_to' => $limit_to,
How to add a second sidebar (WP widgetized area)
There is sample code in the child functions.php file that can be uncommented and customized, to create the sidebar.
To render the sidebar in a template use code like:
- <!--?php if ( is_active_sidebar( 'tf-extrasidebar-1' ) ) { ?-->
<!--?php if ( is_active_sidebar( 'tf-extrasidebar-1' ) ) { ?-->
Here is a demo page.
Enable Featured Images
- // example how to add featured images:
- // to all post types
- add_theme_support( 'post-thumbnails');
- // just to certain post types (CPT):
- add_theme_support( 'post-thumbnails', array( 'tribe_events' ) );
// example how to add featured images: // to all post types add_theme_support( 'post-thumbnails'); // just to certain post types (CPT): add_theme_support( 'post-thumbnails', array( 'tribe_events' ) );
User Emails From
- // how to change email "from" info for all user emails (except the "here's your account and password" email)
- add_filter('wp_mail_from', 'new_mail_from');
- function new_mail_from($old) {
- return "admin@" . $_SERVER['SERVER_NAME'];
- }
- add_filter('wp_mail_from_name', 'new_mail_from_name');
- function new_mail_from_name($old) {
- return 'From Me';
- }
// how to change email "from" info for all user emails (except the "here's your account and password" email)
add_filter('wp_mail_from', 'new_mail_from');
function new_mail_from($old) {
return "admin@" . $_SERVER['SERVER_NAME'];
}
add_filter('wp_mail_from_name', 'new_mail_from_name');
function new_mail_from_name($old) {
return 'From Me';
}

