template/wordpress/index.php in edge_framework-0.6.0 vs template/wordpress/index.php in edge_framework-0.6.1
- old
+ new
@@ -1,10 +1,57 @@
<?php
-/**
- * Home / Landing page
- */
-get_header(); ?>
+/* ----------------------
+ Home / Landing page
+---------------------- */
+get_header();
-<h1>Welcome</h1>
-<p>To customize this message, edit "index.php"</p>
+// Get list of all categories
+$args = array(
+ "child_of" => 0,
+ "hide_empty" => false,
+);
+$categories = get_categories($args);
+
+// Get list of all pages
+$page_args = array(
+ 'child_of' => 0,
+ 'sort_order' => 'ASC',
+ 'sort_column' => 'post_title',
+);
+$pages = get_pages($args);
+?>
+
+<p><small>index.php</small></p>
+
+<h1>Welcome to <?php bloginfo('name'); ?></h1>
+
+<h3>Category</h3>
+<ul>
+ <?php foreach ($categories as $category): ?>
+ <li>
+ <a href="<?php echo get_category_link( $category->ID ); ?> ">
+ <?php echo $category->name; ?>
+ </a>
+ </li>
+ <?php endforeach; ?>
+</ul>
+
+<h3>Pages</h3>
+<ul>
+ <?php foreach ($pages as $page): ?>
+ <li>
+ <a href="<?php echo get_page_link( $page->ID ); ?> ">
+ <?php echo $page->post_title; ?>
+ </a>
+ </li>
+ <?php endforeach; ?>
+</ul>
+
+<!-- How to get Page content outside "page" template -->
+<h3>About Us</h3>
+<?php
+ $page = get_page_by_title("About Us");
+ $content = apply_filters('the_content', $page->post_content);
+ echo $content;
+?>
<?php get_footer(); ?>
\ No newline at end of file