-
-
Save atwellpub/66418869c98164775677 to your computer and use it in GitHub Desktop.
Example single-landing-page.php file for Genesis Child Theme
This file contains 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 | |
remove_action( 'genesis_before_post_content', 'genesis_post_info' ); | |
/** Remove the entry meta in the entry header (requires HTML5 theme support) */ | |
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); | |
/** uncomment line below if you are using any after post widgets */ | |
remove_action( 'genesis_after_post_content', 'genesis_after_post' ); | |
/** Remove the post meta function */ | |
remove_action( 'genesis_after_post_content', 'genesis_post_meta' ); | |
/** Remove the comments template */ | |
remove_action( 'genesis_after_post', 'genesis_get_comments_template' ); | |
/* Add Landing Page Sidebar to Landing Page Custom Post Type */ | |
add_action('get_header','linus_change_genesis_sidebar'); | |
function linus_change_genesis_sidebar() { | |
if ( is_singular('landing-page')) { // Check if we're on a single post for my CPT called "Landing Page" | |
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' ); //remove the default genesis sidebar | |
add_action( 'genesis_sidebar', 'inbound_do_sidebar' ); //add an action hook to call the function for my custom sidebar | |
} | |
} | |
//Function to output my custom sidebar | |
function inbound_do_sidebar() { | |
dynamic_sidebar( 'lp_sidebar' ); | |
} | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment