最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp query - How to allow a variable with "" in wordpress url

programmeradmin1浏览0评论

I use an API to get a list of jobs. I have created 3 templates. The 1st shows the list of jobs, the 2nd the details of the job selected and the 3rd a form. To create the URL for the form I must use a variable $reference which equals to "ref/ClientName".

But when I click on the button that redirect to the form template, the URL is changed. The "/" in the variable $reference is removed so it becomes "refClientName" instead of "ref/ClientName".

How can I make WordPress to keep my variable with the "/"? Thanks

This what I've tried

//$ref = $_GET['ref'];

global $wp_query;

$ref = $wp_query->query_vars['ref'];

$json=file_get_contents(".json?headers=false&validators=true&ref=$ref&lang=fr");

The ref=$ref stores the variable

发布评论

评论列表(0)

  1. 暂无评论