- This topic has 3 replies, 2 voices, and was last updated 2 years, 11 months ago by
Ying.
-
AuthorPosts
-
March 26, 2023 at 9:22 am #2582964
Jens
Dear Generatepress team,
we are using Generatepress and Generateblocks. Additionally we have FacetWP on two archives (links in private information).
As the FacetWP filters were not showing we used a proposed fix from the support forum here which made the filters appear.
/** ** add facetwp-template div around main content area in GeneratePress **/ add_action('generate_before_main_content', function(){ if ( is_post_type_archive( 'template' ) || is_tax( 'template-type' ) || is_tax( 'template-style' )) { ?><div class="facetwp-template"><?php } }); add_action('generate_after_main_content', function(){ if ( is_post_type_archive( 'template' ) || is_tax( 'template-type' ) || is_tax( 'template-style' )) { ?></div><?php } }); add_action('generate_before_main_content', function(){ if ( is_post_type_archive( 'jobs' ) || is_tax( 'job-group' ) ) { ?><div class="facetwp-template"><?php } }); add_action('generate_after_main_content', function(){ if ( is_post_type_archive( 'jobs' ) || is_tax( 'job-group' )) { ?></div><?php } });Unfortunately the cards that we had generated get broken with that fix somehow. Please note, that we also use another code from the forum here to show the cards in a four column layout:
/* Columns for template archive */ add_filter( 'generate_blog_columns','tu_portfolio_columns' ); function tu_portfolio_columns( $columns ) { if ( is_post_type_archive( 'template' ) || is_tax( 'template-type' ) || is_tax( 'template-style' ) ) { return true; } return $columns; } add_filter( 'generate_blog_get_column_count', function( $column_width ) { if ( is_post_type_archive ( 'template' ) || is_tax( 'template-type' ) || is_tax( 'template-style' ) ) { return '25'; } return $column_width; } ); add_filter( 'generate_blog_columns','tu_jobs_columns' ); function tu_jobs_columns( $columns ) { if ( is_post_type_archive( 'jobs' ) || is_tax( 'jobs-group' ) ) { return true; } return $columns; } add_filter( 'generate_blog_get_column_count', function( $column_width ) { if ( is_post_type_archive ( 'jobs' ) || is_tax( 'jobs-group' ) ) { return '25'; } return $column_width; } );Many thanks in advance!
March 26, 2023 at 11:00 am #2583063Ying
StaffCustomer SupportHi there,
Can you try adding this CSS?
.facetwp-template { display: flex; flex-wrap: wrap; }Adding CSS: https://docs.generatepress.com/article/adding-css/
For the block element – content template (jobs), can you remove the
facetwp-templateclass from the GB container?
https://www.screencast.com/t/VmINbDB6bHDMarch 27, 2023 at 2:01 am #2583680Jens
Thanks a lo! That did the trick.
March 27, 2023 at 9:20 am #2584409Ying
StaffCustomer SupportGlad to hear that 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.