Skip Navigation

[Resolved] Query strings being added to archive page URLs

This support ticket is created 5 years, 12 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 23 replies, has 3 voices.

Last updated by Luo Yang 5 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#1197635

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Luo is on vacation. This is Minesh here and I'll try to help you further.

Well - I check the internal ticket and there is no news to share with you as well as Luo said there is no ETA on this.

#1198331

Hello,

Please let me know if you need more assistance for using filter hook wpv_filter_wpv_get_object_unique_hash to remove the URL parameter "wpv_view_count", it works fine in my localhost with a wordpress archive page without AJAX pagination or search form.

You can provide a test site with same problem, and fill below private message box with login details and FTP access, also point out the problem page URL and view wordpress archive URL, and where I can edit your PHP codes, I need a live website to test and debug.

Thanks

#1198974

Dear Matt,

I have tried the credentials you provided above:
1) user name "luoyang", it is not an admin account
2) in the URL hidden link, I see below message only:
Development Site
Please ignore.

So I can not debug the codes in your website, please check it, make sure it is a valid admin account. thanks

#1199173

Hi

Apologies I forgot to set the user as an admin, I have now done this.

You will be able to see the URL now when you login as well, you were only seeing this message because the account was set to subscriber status.

Cheers.

#1199566

Thanks for the details, I have done below modification in your website:
Dashboard-> Snippets, add a new Snippets:
hidden link

Add the same codes as I mentioned in post:
https://toolset.com/forums/topic/query-strings-being-added-to-archive-page-urls/#post-1175781

Test it in front-end:
hidden link

It works fine, please check it. thanks

#1204071

Hey Luo

That works perfectly! 🙂

Is there a way to include multiple IDs in this same query? So I can enable this on more than one archive template?

Or should I add the exact same code for each one? Seems like it would be more streamlined though to put them all in one query?

Cheers.

#1204160

Yes, you can use PHP function in_array() to include multiple IDs, for example, modify this line from:

if($view_settings['view_id'] == 22502){

To:

if(in_array($view_settings['view_id'], array( 22502, 123, 456 )){

More help:
hidden link

#1204961

Hi Luo

This code is a little over my head (in terms of understanding it) but thanks for the info! I just tried to use it anyway and it came back with an error.

I think I fixed it though. I think it just needed another ) on the end to close off the array.

e.g.

if(in_array($view_settings['view_id'], array( 22502, 123, 456 ))){

That seems to work fine, just posting in case anyone else looks at this thread and wants to use the code. ?

Cheers.
Matt

#1205222

Thanks for sharing the solution,that will help other users.