Skip to content

Instantly share code, notes, and snippets.

@sergiopvilar
Created August 31, 2012 22:08
Show Gist options
  • Save sergiopvilar/3559819 to your computer and use it in GitHub Desktop.
Save sergiopvilar/3559819 to your computer and use it in GitHub Desktop.
<?php
// Faz a query no Wordpress
query_posts('category_name=lancamentos');
// Faz o laço de posts
while(have_posts()): the_post();
// Conteúdo do post aqui
// the_content(), the_title(), etc
endwhile;
// Reseta a query que está em cache
wp_reset_query();
?>
@rodrigobarbosa
Copy link

                <li><a id="pre-lancamentos-bt" class="imoveis-ativados">Pré-lançamentos</a>
        <?php
            // Faz a query no Wordpress
            query_posts('category_name=pre-lancamentos');
            // Faz o laço de posts
                $paged = ( isset( $my_query_array['paged'] ) && !empty( $my_query_array['paged'] ) ) ? $my_query_array['paged'] : 1; 
                    global $wp_query;
                    $loop = new WP_Query( array( 'cat' => 9, 'posts_per_page' => 20, 'paged' => get_query_var('paged') ) );

                while(have_posts()): the_post();
                    <li><b><h1><a href="<?php the_permalink() ?>">
                    <p><?php the_post_thumbnail( 'thumbnail' ); ?></p>
                    <p><?php the_title(); ?>
                    <p class="descricao"><?php echo get_post_meta(get_the_ID(),'resumo',true) ?></p>
                    </h1></b></a></li>              
            endwhile; 
            // Reseta a query que está em cache
            wp_reset_query();
        ?>          
        </li>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment