Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
E ai Galera
Estou com um dificuldade e gostaria da ajuda de vocês.
Estou fazendo um site e na pagina inicial deixei para ser exibido apenas as 3 ultimas postagens e mostrar somente de uma determinada categoria.
Porem quando eu uso o codigo
<?php query_posts('cat=1'); ?> que faz mostrar somente os posts da categoria 1, ao clicar-se no botão "Mostrar posts mais antigos" os posts mais antigos não são mostrados, fica travado nos 3 ultimos posts.Porem se eu retirar o o codigo "<?php query_posts('cat=1'); ?>" eu consigo mostrar os posts mais antigos porem aparece as outras categorias que não podem aparecer.
Estou usando o wordpress 3.0 e o thema que vem padrão no wordpress 3.0 o thema "Twenty Ten 1.0" porem modifiquei para ficar da forma que preciso.
Alguem poderia dar uma idéia sobre o que posso fazer.
Abaixo está um pedaço do código para terem uma ideia.
<?php
/* Start the Loop.
*
* In Twenty Ten we use the same loop in multiple contexts.
* It is broken into three main parts: when we're displaying
* posts that are in the gallery category, when we're displaying
* posts in the asides category, and finally all other posts.
*
* Additionally, we sometimes check for whether we are on an
* archive page, a search page, etc., allowing for small differences
* in the loop on each template without actually duplicating
* the rest of the loop that is shared.
*
* Without further ado, the loop:
*/ ?>
<?php query_posts('cat=1'); ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php /* How to display posts in the Gallery category. */ ?>
<?php if ( in_category( _x('gallery', 'gallery category slug', 'twentyten') ) ) : ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<div class="entry-meta">
<?php twentyten_posted_on(); ?>
</div><!-- .entry-meta -->
<div class="entry-content">
<?php if ( post_password_required() ) : ?>
<?php the_content(); ?>
<?php else : ?>
<div class="gallery-thumb">
<?php
$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
$total_images = count( $images );
$image = array_shift( $images );
$image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
?>
<a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
</div><!-- .gallery-thumb -->
<p><em><?php printf( __( 'This gallery contains <a %1$s>%2$s photos</a>.', 'twentyten' ),
'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
$total_images
); ?></em></p>
<?php endif; ?>
Valeu Galera
at++
Carregando comentários...