Sha256: cbe677cde89498ad7f1c284befcbed3fff2a048894f566934aae84a483fd1a2a

Contents?: true

Size: 1.16 KB

Versions: 6

Compression:

Stored size: 1.16 KB

Contents

<?php
/* ----------------------
  Home / Landing page
---------------------- */
get_header();

// 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(); ?>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
edge_framework-0.10.0 template/wordpress/index.php
edge_framework-0.9.12 template/wordpress/index.php
edge_framework-0.9.11 template/wordpress/index.php
edge_framework-0.9.10 template/wordpress/index.php
edge_framework-0.9.9 template/wordpress/index.php
edge_framework-0.9.0 template/wordpress/index.php