我使用WordPress的在下面的简码:如何accsss函数中的查询字符串?
function customquery() {
query_posts('cat=18&tag=mytag');
}
add_shortcode('query', 'customquery');
上述工作正常。我需要“标记”来接受来自URL查询字符串的参数。我试过这个:
query_posts('cat=18&tag='.$_GET["tag"].'''');
这打破了页面。由于这是简码,我不确定是否需要将某些内容作为函数参数传递。但是,我没有看到。$ _get [“tag”]可以作为参数执行。我还能如何做到这一点?
您是从' '' '''部分得到一个语法错误。 – Ultimater 2013-03-15 04:07:47