Skip Navigation

[Resolved] Options for not displaying all posts when a URL parameter is missing.

This support ticket is created 5 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Shane 5 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#1197462

Tell us what you are trying to do?
I filter information based on a parameter that is set in the URL. If someone tries to visit the page(s) and the URL parameter is absent, the view loops through all posts and displays all of them. I'm looking to see if there's a way to check if the URL parameter exists and if it's not present/has a null value either execute a redirect or stop the view from rendering.

Is there any documentation that you are following?
No.
Is there a similar example that we can see?

What is the link to your site?
hidden link

#1197537

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Josh,

Thank you for contacting our support forum.

What you can do is to use our conditional code to do this.

Here is an example of what i'm referring to.


[wpv-conditional if="('[wpv-search-term param="urlparameter"]' ne '' )"]

Display something if the parameter is filled

[/wpv-conditional]
[wpv-conditional if="('[wpv-search-term param="urlparameter"]' eq '' )"]

Display something if the parameter is not filled

[/wpv-conditional]

Please let me know if this helps.

Thanks,
Shane

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.