Sha256: 6def4fb1047010eb67bf299ad9e8965ba98b4caf29e77e5201c4aa6a98d7d99b

Contents?: true

Size: 1.16 KB

Versions: 2

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

2 entries across 2 versions & 1 rubygems

Version Path
edge_framework-0.8.1 template/wordpress/index.php
edge_framework-0.6.1 template/wordpress/index.php