简体   繁体   中英

Add parameters to internal wordpress links

I'm trying to add query parameters to all internal links inside a wordpress blog.

for example- client lands on the blog with this link:

www.example.com/?p1=test&p2=test

I want the links inside the blog, for example a link to a post, to still have the query strings:

www.example.com/post1/?p1=test&p2=test

Is there is a way to do it?

Thanks

Yes you can do this using add_query_arg( 'Key', 'value', 'url' ); For more information visit this link https://developer.wordpress.org/reference/functions/add_query_arg/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM