Skip to content

Instantly share code, notes, and snippets.

@rajvanshipradeep15
Created May 21, 2013 09:52
Show Gist options
  • Save rajvanshipradeep15/5618678 to your computer and use it in GitHub Desktop.
Save rajvanshipradeep15/5618678 to your computer and use it in GitHub Desktop.
wordpress: get_pages
<?php
$pages = get_pages();
?>
<?php $count = 1; ?>
<div class="span12">
<?php
foreach ( $pages as $page ) {
$page_link = get_page_link( $page->ID );
$title = $page->post_title;
?>
<?php if($count < 4 && $title != 'Home') : ?>
<div class="span4">
<div class="">
<?php echo get_the_post_thumbnail($page->ID, 'medium'); ?>
</div>
<h3 class="entry-title"><a style="color:#e052ac;" href="<?php echo $page_link; ?>"><?php echo $title; ?></a></h3>
<?php echo truncateWords($page->post_content); ?>
</div>
<?php $count++; ?>
<?php endif; ?>
<?php
}
?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment