- This topic has 21 replies, 4 voices, and was last updated 3 years, 3 months ago by
Ying.
-
AuthorPosts
-
December 28, 2022 at 1:32 pm #2476154
Yerai
Hello!
I’m currently using Generateblocks Query Loop block for link to posts or pages. It works nice in the site overall, but in custom category pages.
Category pages are built with wordpress pages, replacing the category page with a custom page with the same slug using a function that loads page template instead of category’s.
Problem is the query loop grid breaks only in those category pages. In the backend everything seems fine, but in the frontend the structure changes.
Backend:

Frontend:

Is there a way to fix that?
Thank you in advance!
December 28, 2022 at 6:32 pm #2476322Fernando Customer Support
Hi Yerai,
If you’re planning to override the default WordPress Archive pages with a Query Loop Block, you can use a Block Element – Loop Template.
Reference: https://docs.generateblocks.com/article/query-loop-overview/
If you prefer using a static page, can you provide the link where we can see the issue?
You may use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
December 31, 2022 at 7:19 am #2478837Yerai
Apologies for answering this late, these last days have been crazy for me.
Yeah, we are using static pages. I’ll provide the url and credentials in the private info section.
Thank you in advance!
January 1, 2023 at 6:13 pm #2480080Fernando Customer Support
Happy New Year, Yerai!
This is odd. Can you also provide admin login credentials as well so we can take a closer look at your setup?
Please use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
January 2, 2023 at 2:35 pm #2481237Yerai
Here you have!
Thank you in advance.
January 2, 2023 at 5:21 pm #2481320Fernando Customer Support
Thank you. It seems some CSS is not loading.
As a first course of debugging, what we would recommend is to do #1 here: https://docs.generatepress.com/article/debugging-tips/
Can you try that and let us know how it goes?
It would be good to take a backup of your site before doing so.
January 3, 2023 at 3:54 am #2481778Yerai
I did all steps there, as the first one didn’t have any effect.
The debug.log file didn’t generate, and I didn’t saw any error in the dashboard.
After that, I installed the query count plugin for debugging, I didn’t see anything relevant.
So I moved to the next step.
After switching to TwentySeventeen theme, the issue fixed. And after switching back to GeneratePress, the page loaded correctly. A while after it showed up the issue again.
And finally, there is are no errors in the error_log file.
So I guess there is a weird issue that happens with GeneratePress, because GenerateBlocks loaded fine in the TwentySeventeen theme, but maybe I’m mistaken.
Thank you in advance.
January 3, 2023 at 9:03 am #2482396David
StaffCustomer SupportHi there,
what function are you using to swap the category archive to a static page ?
January 3, 2023 at 9:36 am #2482451Yerai
Hi David,
We are using this function:
function loadPageFirst() {
// get the actual category
$actualCategory = get_category( get_query_var(‘cat’) );
// get the page with the same slug
$matchingPage = get_page_by_path( $actualCategory->slug );// If no match, load the normal archive template and exit
if (!$matchingPage) {
include( get_template_directory() . ‘/archive.php’);
die();
}// Make a new query with the page’s ID and load the page template
query_posts( ‘page_id=’ . $matchingPage->ID );
include( get_template_directory() . ‘/page.php’);
die();
}
add_filter( ‘category_template’, ‘loadPageFirst’ );January 4, 2023 at 3:26 am #2483159David
StaffCustomer SupportAre all Category pages to be replaces with a Static Page ? As i wonder if this method would work better:
https://docs.wpshowposts.com/article/use-static-pages-as-category-archives/
January 4, 2023 at 5:14 am #2483276Yerai
Yes, all category pages are replaced by a static page. The method you provided works very well. There is no issue now! 🙂
Thank you David!
January 4, 2023 at 8:09 am #2483599David
StaffCustomer SupportAwesome – glad to hear that!!
January 11, 2023 at 8:49 am #2491658Yerai
Hello again!
I’ve found an issue with the code of WPShowPosts.
In my site there is no more custom code than that one, but for some reason, posts pages are being replaced by the category page, as you can see here:
Category page:

Post page:

Curious thing is post’s urls are untouched, which seems weird.
Is there a way to fix this?
January 11, 2023 at 11:50 am #2491857Ying
StaffCustomer SupportGo to settings > permalinks, set
.as theCategory base.Let me know if this works.
January 11, 2023 at 11:59 am #2491880Yerai
Sadly, it doesn’t work 🙁
-
AuthorPosts
- You must be logged in to reply to this topic.