NO BUG: URL parameter from filter doesn't work in a link if the filter type is set to posts: post type

Browser: Chrome 110
OS: macOS
Bricks Version: 1.12.5
Video: Jam

I’ve got a page that loads blog posts and two custom post types, and has several taxonomy filters. The filters which are set to filter by a taxonomy both work just fine. I can also create a link with URL parameters to a pre-filtered page, which also works fine.

However, one of my filters is set to sort by post type. This works from within the normal page, however when trying to create a link that has a URL parameter added for this filter, it does not work, and no posts of any type will load.

Post Type filter parameter in URL (does not work):
https://sevengenerationsahead.org/news-resources/?_sga_resource=post

Taxonomy filter parameter in URL (does work): News & Resources – Seven Generations Ahead

If you go the page normally without any URL parameters, and then select a post type, the filtering works totally fine: News & Resources – Seven Generations Ahead

Also interesting is that when trying to link to a page that is filtered by the post type, changing to a different post type does not update the URL parameter or update the results which are shown. If you go to the first link, and try to change the ‘Resource Type’ from News (posts) to Case Studies or Resources, it does not update. However this works totally fine on the other taxonomy filters / URL parameters.

Here is a screenshot of the settings for the filter that is set to filter by post type:

Hi @EricE,

can you also make a screenshot of the query loop settings, just so I can try to replicate it locally?

Thank you,
Matej

Sure thing, here you go:

Hi @EricE,

thank you so much. I sadly can’t replicate the issue :thinking:. Can you try to disable all plugins and custom scripts, just to check if it works then?

Thank you,
Matej

Hey @Matej - Yes I tried that before creating this thread. I removed all custom code from functions.php, and disabled every single plugin but the issue remains.

When inspecting the page structure, one thing I noticed is the DOM structure changes. The posts widget is replaced by a tag…

Normally, it looks like this:

But when appending the URL parameter to sort by post type, that element is replaced with an empty tag as follows:

Not sure if that’s helpful for you at all. I am not using any templates in the actual builder, FYI.

Hmm. I’m not sure. I noticed you are using 1.12.5, but I tested with that version, and it works as well. Maybe you can create a staging website, and test with 2.0.1 there, just to be sure?

So I guess I have a different setup than you. I’ll ask my colleague about it, as he was working on that feature. But if we don’t figure it out, I’ll need login access to your (staging?) website. I’ll let you know.

Thanks,
Matej

Hi @EricE,

could you try the following suggestions:

  1. Remove the _sga_resource parameter from the Query Filter, so that it uses a default one. Just to make sure that _sga_resource is not a reserved parameter on your website.
  2. On the custom query, enable the “Is Main Query” checkbox.

Please let me know if this solves the issue, but if not, can you send temporary login credentials to your test/staging (if you have it) website and a link to this topic to help@bricksbuilder.io using the email address you used during the purchase so we can take a look?

Thank you,
Matej

Oh man, it seems that was a reserved parameter after all, even though I swore I had already double checked my custom post types and taxonomies to rule that out, as well as added the “sga” prefix… But apparently not!

Thanks a lot @Matej ! Can definitely close this one out now.

Hi @EricE,

thanks for confirming. I’m glad it’s solved now. I’ll mark the topic as no-bug :slight_smile:

Best regards,
Matej

1 Like