Skip to content

Instantly share code, notes, and snippets.

@AchalJ
Created July 6, 2020 10:23
Show Gist options
  • Save AchalJ/37fe8692b108f4d3b4d5aa6f6204738d to your computer and use it in GitHub Desktop.
Save AchalJ/37fe8692b108f4d3b4d5aa6f6204738d to your computer and use it in GitHub Desktop.
PP Header / Footer support for Ascend Premium theme
// PP Header / Footer.
add_filter( 'pp_header_footer_theme_slug', 'acsend_pp_header_footer_slug' );
function acsend_pp_header_footer_slug( $slug ) {
return 'ascend_premium';
}
add_action( 'pp_header_footer_after_setup', 'acsend_pp_header_footer_setup' );
function acsend_pp_header_footer_setup( $slug ) {
if ( 'ascend_premium' === $slug || 'ascend_premium_child' === $slug ) {
add_action( 'wp', 'acsend_pp_header_footer_init' );
}
}
function acsend_pp_header_footer_init() {
if ( ! class_exists( 'BB_PowerPack_Header_Footer' ) ) {
return;
}
if ( ! empty( BB_PowerPack_Header_Footer::$header ) ) {
remove_all_actions( 'ascend_header' );
add_action( 'ascend_header', 'BB_PowerPack_Header_Footer::render_header' );
}
if ( ! empty( BB_PowerPack_Header_Footer::$footer ) ) {
remove_all_actions( 'ascend_footer' );
add_action( 'ascend_footer', 'BB_PowerPack_Header_Footer::render_footer' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment