WordPress Snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* The purpose of this code is to show how you can use theme mods that will fall back to | |
* the already-set mods of the parent theme. So, when a child theme is active, the code | |
* checks, in the following order: 1) child theme mod, 2) parent theme mod, 3) default. | |
*/ | |
function jt_get_theme_mod( $name, $default = false ) { | |
if ( is_child_theme() ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Conditionally change menus | |
add_filter( 'wp_nav_menu_args', 'bb_wp_nav_menu_args' ); | |
function bb_wp_nav_menu_args( $args = '' ) { | |
// change the menu in the Header menu position | |
if( $args['theme_location'] == 'header' && is_page('1159') ) { | |
$args['menu'] = '32'; // 32 is the ID of the menu we want to use here | |
} | |
return $args; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( function( api ) { | |
'use strict'; | |
// Add callback for when the header_textcolor setting exists. | |
api( 'header_textcolor', function( setting ) { | |
var isHeaderTextDisplayed, linkSettingValueToControlActiveState; | |
/** | |
* Determine whether the site title and tagline should be displayed. | |
* |