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 | |
| // add hook | |
| add_filter( 'wp_nav_menu_objects', 'my_wp_nav_menu_objects_sub_menu', 10, 2 ); | |
| // filter_hook function to react on sub_menu flag | |
| function my_wp_nav_menu_objects_sub_menu( $sorted_menu_items, $args ) { | |
| if ( isset( $args->sub_menu ) ) { | |
| $root_id = 0; | |
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
| if ( !class_exists( 'HijackMe' ) ) { | |
| class HijackMe { | |
| public function hijack_menu($objects) { | |
| /** | |
| * If user isn't logged in, we return the link as normal | |
| */ | |
| if ( !is_user_logged_in() ) { | |
| return $objects; | |
| } | |
| /** |
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
| /** | |
| * Hide the main editor on specific pages | |
| */ | |
| define('EDITOR_HIDE_PAGE_TITLES', json_encode(array())); | |
| define('EDITOR_HIDE_PAGE_TEMPLATES', json_encode(array('template-cars.php'))); | |
| /** | |
| * Hide the main editor on defined pages | |
| * |
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 | |
| // First we include it in the genesis-structural-wrap genesis declaration | |
| add_theme_support( 'genesis-structural-wraps', array( | |
| 'header', | |
| // 'nav', | |
| // 'subnav', | |
| 'site-inner', | |
| 'footer-widgets', | |
| 'page-header-img', //here is it | |
| 'footer' |
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 | |
| // do NOT include the opening line! Just add what's below to the end of your functions.php file | |
| add_action( 'edit_form_after_title', 'rgc_posts_page_edit_form' ); | |
| function rgc_posts_page_edit_form() { | |
| global $post, $post_type, $post_ID; | |
| if ( $post_ID == get_option( 'page_for_posts' ) && empty( $post->post_content ) ) { | |
| add_post_type_support( $post_type, 'editor' ); | |
| } |
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 | |
| //do not add in opening php tag | |
| /** | |
| * Custom Genesis Home Loop with Character Limitation on Excerpt | |
| * | |
| * @package Custom Genesis Home Loop with Character Limitation on Excerpt | |
| * @author Neil Gee | |
| * @link http://wpbeaches.com | |
| * @copyright (c)2014, Neil Gee |
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
| //* Wrap .nav-primary in a custom div | |
| add_filter( 'genesis_do_nav', 'genesis_child_nav', 10, 3 ); | |
| function genesis_child_nav($nav_output, $nav, $args) { | |
| return '<div class="nav-primary-wrapper">' . $nav_output . '</div>'; | |
| } | |
| //* Wrap .nav-secondary in a custom div | |
| add_filter( 'genesis_do_subnav', 'genesis_child_subnav', 10, 3 ); |
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
| // Add background-color to .footer-widgets | |
| add_filter( 'genesis_attr_footer-widgets', 'ap_attributes_footer_widgets' ); | |
| function ap_attributes_footer_widgets( $attributes ) { | |
| $background = get_field('footer_widgets_bg', option); | |
| $attributes['style'] = 'background-color:' . $background . ';'; | |
| return $attributes; | |
| } |
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
| //* Add the site tagline section | |
| add_action( 'genesis_after_header', 'minimum_site_tagline' ); | |
| function minimum_site_tagline() { | |
| if (is_home() ) | |
| printf( '<div %s>', genesis_attr( 'site-tagline' ) ); | |
| genesis_structural_wrap( 'site-tagline' ); | |
| printf( '<div %s>', genesis_attr( 'site-tagline-left' ) ); | |
| printf( '<p %s>%s</p>', genesis_attr( 'site-description' ), esc_html( get_bloginfo( 'description' ) ) ); | |
| echo '</div>'; |
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 | |
| /** | |
| * This file adds widgetized Home Page. | |
| * | |
| */ | |
| add_action( 'get_header', 'prefix_home_genesis_meta' ); | |
| /** | |
| * Add widget support for homepage. If no widgets active, display the default loop. | |
| * |