Archived topic
Trying to remove "?tx_portfolio_cat=" from 'portfolio' url.
8 replies · Started by Mark on August 13, 2019
Hi guys,
I hope you are all well? Was hoping you could help?
We have created some thumbnail galleries and categories using the Content Views Pro plugin.
For some reason though when using Wordpress 'Portfolio' CV puts this (?tx_portfolio_cat=) in the url which is really annoying. Below is a test where we are trying to include the category name in the url, like 'toys'.
https://gravity360.co.uk/360-2/product-photography/gallery/?tx_portfolio_cat=toys
Ideally I would like this below:
https://gravity360.co.uk/360-2/product-photography/gallery/toys
or just:
https://gravity360.co.uk/360-2/product-photography/toys
I have been trying to resolve this with CV but they say removing these random letters etc are impossible. What is frustrating is that if the CV galleries were setup as a post then this problem would not exist.
Do you have any ideas on how we could exclude this code, with CSS perhaps?
Or would this break the way it sorts the categories etc?
As always, any help greatly appreciated.
Thanks, Mark
Hi there,
that is a query string, as the content is dynamically being displayed it is required.
You can't alter it with CSS, it would require custom development - and it sounds like the plugin author is reluctant to provide assistance with that.
Hi David,
Thanks for your reply, helpful as always!
Could something like this work do you think, option 1 using the 'Code Snippets Plugin'?
https://kinsta.com/knowledgebase/remove-query-strings-static-resources/
With regards to Cv support, I am not sure if this is because it cannot be done. Just that they are maybe not interested in doing it or coming up with a solution.
Thanks again for any suggestions/help.
Cheers, Mark
I just wondered if I could modify this code (entered into the Code Snippets Plugin) to hide this (?tx_portfolio_cat=) from appearing in the url on the front end of the site?
Let me know whether you think this may be possible? Thanks, Mark
Code:
function remove_query_strings() {
if(!is_admin()) {
add_filter('script_loader_src', 'remove_query_strings_split', 15);
add_filter('style_loader_src', 'remove_query_strings_split', 15);
}
}
function remove_query_strings_split($src){
$output = preg_split("/(&ver|\?ver)/", $src);
return $output[0];
}
add_action('init', 'remove_query_strings');
You can absolutely try and see if that works for you.
If not then you will need bug the plugin support some more.
Unfortunately, we have to limit the support we provide for other plugins.
Thanks for your understanding :)
Hi Leo,
Thanks for your reply.
If you can offer a suggestion/solution that utilises GP/CSS (something else) and not a 3rd party Plugin I would still be keen to very hear it!
Please try me as I am close to exhaustion on this issue.
Thanks so much.
Cheers, Mark
CSS cannot modify the URL structure as David already mentioned. It will require custom development of modifying the code within the plugin.
I would recommend bugging the plugin developer some more.
Sorry we couldn't be more helpful :(
Hi Leo, OK - thanks so much anyway. Cheers, mark
No problem :)
Good luck!