0
我有一个函数在我的WordPress主题functions.php
文件用下面的代码:一个WordPress页面上运行自定义功能
function locations() {
$locations_list = array();
query_posts(array('orderby' => 'date', 'order' => 'DESC' , 'post_type' => 'location'));
while(have_posts()) {
$locations_list[the_slug()] = the_title();
}
wp_reset_query();
return $locations_list;
}
的想法是,我可以在我的网站的任何地方运行这个功能,它将存储我的所有帖子都在数组中。
但是,我不知道我是如何在公共端运行此:“(
完美的世界,我想在我的footer.php
脚本运行此
任何帮助将不胜感激。 。
我会给它一个旋转。不会是片刻:-) – michaelmcgurk
工作完美 - 非常感谢! – michaelmcgurk