Remove Header/Footer when Post/Page is displayed in Fancybox
-
To display a post in a fancybox, appearntly all you need to do is add the
class="grouped_elements"
to you link code, ie.,<a class="grouped_elements" href="https://example.com">https://example.com</a>
What I would like to do is apply this hook:
add_action('template_redirect' , 'set_hooks'); function set_hooks() { //the following says : "if the current context is not 404 error, then do nothing (return) " if ( ! is_single() ) return; //remove actions remove_all_actions('__header'); remove_all_actions('__footer'); }
To all instances when the fancybox (
class=grouped_elements
)is being used.
Note,is_single
is being used to denote a single post. The example usesis_404
.I’ve also used this for reference: https://codex.www.ads-software.com/Function_Reference/remove_action, but i end up breaking my site still.
global $my_class; remove_action( 'the_content', array( $my_class, 'class_filter_function' ) );
…should correlate with
class="grouped_elements"
, i’m just not sure how
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Remove Header/Footer when Post/Page is displayed in Fancybox’ is closed to new replies.