admin管理员组文章数量:1327849
how can I remove a parameter from a URL in wordpress? for example if I have the following URL: /?cat=4&paged=2&order=DESC How can I remove paged from it?
how can I remove a parameter from a URL in wordpress? for example if I have the following URL: http://domain/?cat=4&paged=2&order=DESC How can I remove paged from it?
Share Improve this question asked Aug 23, 2012 at 16:02 Feras OdehFeras Odeh 4351 gold badge8 silver badges16 bronze badges2 Answers
Reset to default -1You should use pretty permalink. Please read this docs from WordPress Codex for full information.
Using remove_query_arg() to remove query string from the URL.
For example, to remove the paged
query string from the current page URL:
remove_query_arg('paged', false); //FALSE, means to use the current URL
If you have specific URL:
remove_query_arg('paged', 'http://domain/?cat=4&paged=2&order=DESC');
Or if you have multiple query string and you wanted to remove them:
$paramaters = array('cat', 'paged', 'order');
remove_query_arg($paramaters, false); //FALSE, means to use the current URL
本文标签: url rewritingRemove url parameter using wordpress
版权声明:本文标题:url rewriting - Remove url parameter using wordpress 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742217340a2434812.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论