我有網址http://domain.com/real-estate-news/phuket-luxury-property-in-high-demand-ms 其中「real-estate-news」是類別,「phuket-luxury-property-in-high-demand-ms」是帖子名稱。 當我打印$ wp_query-> query_vars ['name'];它提供了post slug,$ wp_query-> query_vars ['category_name']給出了類別slug。向wordpress url添加第三個參數
我想產生這樣http://domain.com/real-estate-news/phuket-luxury-property-in-high-demand-ms/xyz
一個新的URL,並希望得到XYZ查詢VAR像
echo $wp_query->query_vars['name']; // print "phuket-luxury-property-in-high-demand-ms"
echo $wp_query->query_vars['category_name']; // print "real-estate-news"
echo $wp_query->query_vars['section']; //print "xyz"
如何在WordPress添加部分查詢變種,請幫助我
不,這不是自定義文章類型。這是簡單的帖子 –