Ability to make link to Ess. Grid with filter already active?

I’ve gone through their documentation, and it doesn’t seem to show what I’m particularly asking for. Wondering if anyone has come across this scenario:

On my X Pro header, I have a pseudo navbar that’s actually a filter of categories, which is awesome - cause it loads via ajax and keeps the viewer engaged. However - When the viewer actually clicks on a post, it goes to the post (which doesn’t have the grid enabled) and the header links all break. I need a way to recreate the link structure (which I’ll do myself), using either a query argument after the url, or some type of data-attribute or whatever I need to. I just need to know if it’s possible.

Goes like this: Home Page Ess Grid > Single Post > Custom link to go to the homepage, with Ess. Grid filter set to filter Category A when it loads. If that makes sense.

Thanks!

I had an idea, and maybe this would point me in the right direction. What if i was to have the link pass a parameter that changes the argument of the WP_Query() loop for each link? Where it basically just passes a query string or data-attribute, and when the PHP sees it, there’s a switch statement that handles if any of those arguments are passed? I don’t need the code; Just the recommended way to add this functionality if it doesn’t already exist in some form or another.

You’ll see what I’m referring to here >> https://joelhager.com/sites/love/

When you view a post, it loses its place and filters, so they’d have to go back to the home page and then re-filter their search again.

Hi There,

That is technically possible. However, that would fall beyond the scope of our support since it would require custom development. You need to contact the 3rd party developer to help you with this.

Thank you for understanding.

I understand it would require custom development, and I’m find doing that on my own. My question is as it relates to its integration with your theme.

If I were to just change the initial args of the WP_Query() loop, would it break any integration with the theme? The reason I ask is I do believe that the WP_Query right now grabs all of the posts, and each button just enables an ajax filter, not a dababase/PHP filter.

In other words: Would it make more sense and be more compatible with X Pro to write a link that has a new arg array for the Query on the server side, or just a re-link back to the homepage with a data-attribute or onclick that would cause the javascript to ‘click’ the correct filter button after the page loads via doc readystate?

Hopefully that makes my question more clear. Thank you.

Hi,

I would prefer to just a re-link back to the homepage with a data-attribute or onclick that would cause the javascript to ‘click’ the correct filter button after the page loads via doc readystate. That would be less intrusive than having to modify WP_Query.

Thanks

?

Looks like you just quoted me.

Hi @jrhager84,

I think Paul recommends the second option that you provided.

As for WP_Query, I think it’s not the integration with the theme, but with the whole Wordpress setup. The only custom WP_Query that is being used in the theme is for the portfolio. The rest is default WP_Query provided by Wordpress itself. Hence, any mistake you’ll introduce will affect the entire site (the Wordpress, any theme, and any plugin). And it’s something we can’t cover since it’s not about integration but Wordpress customization for specific query.

And based on the requirement, I recommend using both WP_Query (for query connected to query_vars) and query_vars (for URL), ajax or not. It’s all the same requests, just different method.

https://codex.wordpress.org/Plugin_API/Filter_Reference/query_vars
https://developer.wordpress.org/reference/hooks/query_vars/

And with query_vars, you’ll have to create your own custom permalinks.

This isn’t theme customization, but Wordpress customization. There is nothing to change in the theme, but you will need to change to create your own requests route that Wordpress will understand.

Thanks!

I ended up paying 35 dollars to Theme Punch to get this answer, so I will post it here to save anyone else who may search the money:

The function I was looking for was called “Deep linking” which is explained here >> https://www.themepunch.com/faq/essential-grid-deep-linking/

Hi again,

Thank you for sharing the solution with us and we’re glad you managed to resolve the issue.

Cheers!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.