Skip to content

Instantly share code, notes, and snippets.

Created March 8, 2012 13:08
Show Gist options
  • Save anonymous/2000923 to your computer and use it in GitHub Desktop.
Save anonymous/2000923 to your computer and use it in GitHub Desktop.
Instruções wordpress
<?php
$banners = new WP_Query();
$banners->query(
array(
'numberposts' => 5,
'post_type' => 'banners',
'orderby' => 'meta_value_num',
'meta_key' => 'ordem',
'order' => 'asc',
'meta_query' => array(
array(
'key' => 'local',
'value' => 'home-full'
)
)
)
);
while ($banners->have_posts()) : $banners->the_post();
$custom_fields = get_post_custom( );
if (has_post_thumbnail ()) {
?>
<li>
<a href="<?php echo $custom_fields['link'][0]; ?>">
<?php the_post_thumbnail('banner-full-home', array('alt' => get_the_title(), 'title' => $custom_fields['resumo'][0])); ?>
</a>
</li>
<?php
}
endwhile;
?>
<?php
$subpaginas = get_pages('child_of=13&sort_column=menu_order&sort_order=asc');
if (count($subpaginas) > 0) {
foreach ($subpaginas as $pagina) {
$content = apply_filters('the_content', $pagina->post_content);
?>
<li>
<section>
<h4><?php echo $pagina->post_title ?></h4>
<?php echo get_the_post_thumbnail($pagina->ID, 'home-list-valores'); ?>
<p><?php echo $content; ?></p>
</section>
</li>
<?php
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment