Skip to content

Instantly share code, notes, and snippets.

@jubalm
Created April 30, 2012 07:37
Show Gist options
  • Save jubalm/2556301 to your computer and use it in GitHub Desktop.
Save jubalm/2556301 to your computer and use it in GitHub Desktop.
wordpress - custom pages section
<div class="secton" id="services">
<div class="container">
<?php
$count = 0;
$slugs = array('page1', 'page2', 'page3');
$pages_array = array();
foreach ($slugs as $slug) {
$page = get_page_by_path($slug);
array_push($pages_array, $page->ID);
}
$mypages = get_pages( array(
'include' => array( $pages_array ),
'sort_column' => 'menu_order'
) );
?>
<?php foreach( $mypages as $page ) : $count++ ?>
<div class="column column-<?php echo $count ?>">
<h4 class="service-title">
<a href="<?php echo get_permalink($page->ID) ?>">
<?php echo $page->post_title ?>
</a>
</h4>
<a href="<?php echo get_permalink($page->ID) ?>">
<?php echo get_the_post_thumbnail($page->ID, 'thumbnail'); ?>
</a>
<div class="entry"><?php echo $page->post_excerpt ?></div>
</div>
<?php endforeach; ?>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment