Digital experiences for all disciplines
New Landing › How can we help? › Cardinal › main nav missing on category pages
New Landing › How can we help? › Cardinal › main nav missing on category pages
- This topic has 11 replies, 3 voices, and was last updated 8 years by Kyle – SUPPORT.
-
Posted in: Cardinal
-
January 19, 2016 at 7:02 pm #242038
I’ve deactivated all plugins except Swift Framework, and main navigation is still missing.
Also footer widgets on category pages are displaying incorrect information.
January 19, 2016 at 7:09 pm #242040Hi,
I notice you are using a child theme, have you checked you are not overwriting this template file?
Thanks.
January 19, 2016 at 8:52 pm #242076child theme has
comments.php
functions.php
single-event.php
single-location.php
style.cssIn functions.php I’m using this code that I previously used with Dante.
// Show custom post types on archives add_action( 'pre_get_posts', 'add_my_post_types_to_query' ); function add_my_post_types_to_query( $query ) { if ( !is_admin() && is_archive() && $query->is_main_query() ) $query->set( 'post_type', array( 'post', 'event', 'testimonial', 'portfolio', 'team', 'galleries') ); return $query; } // Show custom post types on archives add_filter( 'getarchives_where' , 'pdc_getarchives_where_filter' , 10 , 2 ); function pdc_getarchives_where_filter( $where , $r ) { if ( !is_admin () ) $args = array( 'public' => true , '_builtin' => false ); $output = 'names'; $operator = 'and'; $post_types = get_post_types( $args , $output , $operator ); $post_types = array_merge( $post_types , array( 'post', 'event', 'testimonial', 'portfolio', 'team', 'galleries') ); $post_types = "'" . implode( "' , '" , $post_types ) . "'"; return str_replace( "post_type = 'post'" , "post_type IN ( $post_types )" , $where ); }
January 20, 2016 at 10:07 am #242170Hi
Do you get the same issue if you activate the parent theme?
– Kyle
January 21, 2016 at 3:16 am #242394Yes, same issue with parent theme
January 21, 2016 at 2:24 pm #242554Can you please update the theme and let me know if that fixes the issue
– Kyle
January 22, 2016 at 12:43 am #242704same result in Cardinal 2.41
January 22, 2016 at 8:41 am #242747Current version is 2.42
– Kyle
January 25, 2016 at 6:23 am #243164I get the same results with Cardinal 2.42.
—
FYI for the file taxonomy-portfolio-category.php, the sf_base_layout for portfolio-category is missing.January 26, 2016 at 11:39 am #243698@pdupree – I am testing this on my dev version 2.4.2 and the Portfolio => Category pages load the menu fine for me.
– Can you test with all plugins deactivated, leaving only the Swift Framework active. + Please leave your child theme deactive whilst we test.
Thanks.
January 29, 2016 at 1:59 am #244661Here is how I solved this.
In /swift-framework/core/sf-formatting.phpReplaced
/* ADD CPT TAG RESULTS TO ARCHIVES ================================================== */ function sf_add_cpt_tags_to_archive($query) { if ( is_category() || is_tag() ) { $post_type = get_query_var('post_type'); if ( $post_type ) { $post_type = $post_type; } else { $post_type = array('nav_menu_item', 'post', 'portfolio', 'team', 'clients', 'testimonials', 'faqs', 'directory', 'galleries'); } $query->set('post_type', $post_type); return $query; } } add_filter('pre_get_posts', 'sf_add_cpt_tags_to_archive');
with this code I was using in Dante
// Show custom post types on archives add_action( 'pre_get_posts', 'add_my_post_types_to_query' ); function add_my_post_types_to_query( $query ) { if ( !is_admin() && is_archive() && $query->is_main_query() ) $query->set( 'post_type', array( 'post', 'event', 'testimonial', 'portfolio', 'team', 'galleries') ); return $query; } // Show custom post types on archives add_filter( 'getarchives_where' , 'pdc_getarchives_where_filter' , 10 , 2 ); function pdc_getarchives_where_filter( $where , $r ) { if ( !is_admin () ) $args = array( 'public' => true , '_builtin' => false ); $output = 'names'; $operator = 'and'; $post_types = get_post_types( $args , $output , $operator ); $post_types = array_merge( $post_types , array( 'post', 'event', 'testimonial', 'portfolio', 'team', 'galleries') ); $post_types = "'" . implode( "' , '" , $post_types ) . "'"; return str_replace( "post_type = 'post'" , "post_type IN ( $post_types )" , $where ); }
January 29, 2016 at 9:00 am #244707Great! Thanks for sharing
– Kyle
-
Posted in: Cardinal
You must be logged in and have valid license to reply to this topic.