Archived topic
The Loop
5 replies · Started by Marcin on November 23, 2020
Hi,
I am using Search and Filter Pro to display post in Generatepres Query. It displays post perfectly until I tuch the filters. In filter settings it is written that:
* Templates must use the The Loop and not a custom query
I have no idea what does it mean, but I am preaty shure that generatepress has that option. Could You help me?
Hi there,
Sorry what do I need to click to see the issue?
GP uses the default wp_query() for the displaying the posts"
https://developer.wordpress.org/reference/classes/wp_query/
Are you able to check with the plugin author first and see what it would need to work?
Hi, sorry for not responding.
In the left side panel there is a searching widget. It should automaticly work with default query, howewer it looks like it only display results after reload a page.
Ok, I get it, well partly. I need to add my custom post type to wp_querry. Should I recreate archive.php in child theme and there add my custom post?
At the moment I've added another archive: archive-myposttype.php and it does work, but I cannot edit a look of a querry using Generatepress apperance option
It should work like that, but it does not
<?php
/* child style */
function childtheme_enqueue_styles() {
wp_dequeue_style( 'twentytwenty-style' );
wp_enqueue_style( 'parent_style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css' , false,filemtime( get_stylesheet_directory() . '/style.css' ), 'all' );
}
add_action( 'wp_enqueue_scripts', 'childtheme_enqueue_styles', 999 );
//add masonary grid and columns to custom post type
add_filter( 'generate_blog_masonry','tu_dedykacja_masonry' );
function tu_dedykacja_masonry( $masonry ) {
if ( is_post_type_archive( 'dedykacja' ) ) {
return 'true';
}
return $masonry;
}
add_filter( 'generate_blog_columns','tu_dedykacja_columns' );
function tu_dedykacja_columns( $columns ) {
if ( is_post_type_archive( 'dedykacja' ) ) {
return true;
}
return $columns;
}
//end masonary and column
Hmm that code looks good.
Any chance you can remove the other snippets before it to test?
Can you guide us to the page in question?