Archived topic
Footer block elements not showing across whole site
8 replies · Started by Chris on March 8, 2021
Hi, I have a WIP site which a small issue with a site footer element.
The address of the site is visitkefalonia.eu
The footer block is configured to display site wide for all users and had been working as it should. Now that I have added a CPT called 'business', the footer will not load on the CPT category pages eg. https://visitkefalonia.eu/category/activities-excursions/boat-trips-fishing/ but does work on each individual post page eg. https://visitkefalonia.eu/business/kefalonia-fishing-tours/
Any help to resolve this greatly appreciated.
(Site is currently in 'Coming soon' mode)
Thanks
Chris
Hi there,
can you try removing the All Users display rule in the Block Element - its not required.
I have done this now, but this has not changed anything
Odd... can you try changing the Block Type to Hook and select the before_footer hook - does it now display on the archive ?
Still no joy sadly.
Trying different settings, still on a learning curve with CPTs
I suspect that something is blocking the wp_footer call as I have another element that is not being called either (parallax snippet).
I'm afraid I don't yet posess the knowledge to know why :S
Are you using any custom templates / functions for your archive pages?
I am using a function to allow the displaying of CPT in standard post types
add_filter('pre_get_posts', 'query_post_type');
function query_post_type($query) {
if( is_category() ) {
$post_type = get_query_var('post_type');
if($post_type)
$post_type = $post_type;
else
$post_type = array('nav_menu_item', 'post', 'business'); // don't forget nav_menu_item to allow menus to work!
$query->set('post_type',$post_type);
return $query;
}
}
I found the same issue on this thread here, but didn't think to search the forums for lines from that snippet before.
I have determined that I do not need to use the built in 'Categories' as this part of the site is separate and no crossover is required.
To keep it simple, I have disabled the snippet and created my own 'Business Category' taxononmy and this seems to eliminate the problem.
Thanks for nudging a novice in the right direction.
Glad to hear you found the solution!