I have a function in my WordPress theme functions.php
file with the following code:
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;
}
The idea is that I can run this function anywhere on my site and it will store all my posts in an array.
However, I have no idea how I run this at the public end :'(
Perfect world, I'd like to run this in my footer.php
script.
Any help would be greatly appreciated.