forked from cjonasw/wordpress-starter-theme-mustache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-data.php
31 lines (23 loc) · 905 Bytes
/
page-data.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
$data = array(
'wp_title' => wp_title('', false),
'wp_head' => output_buffer_contents(wp_head),
'wp_footer' => output_buffer_contents(wp_footer),
'template_directory_uri' => get_template_directory_uri(),
'stylesheet_url' => get_bloginfo('stylesheet_url'),
'home_url' => esc_url( home_url( '/' ) ),
'blog_title' => get_bloginfo(),
'pages' => get_pages(),
'categories' => get_categories('show_count=0&title_li=&hide_empty=0&exclude=1'),
'seperate_mustache_render_example' => include 'seperate-mustache-render-example.php'
);
// To compensate for Wordpress not providing a url for each post
foreach ( $data['pages'] as $page ) {
$page->permalink = get_permalink($page->ID);
}
// To compensate for Wordpress not providing a url for each category
foreach ( $data['categories'] as $category ) {
$category->link = get_category_link( $category->term_id );
}
return $data;
?>