Josetxo
Dseda
si se puede podrias poner una query personalizada en el index.php de tu wordpress
query_posts(array(
'showposts' => 5,
));
<?php
query_posts(array(
'showposts' => 5,
));
?>
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part('content', 'booklisting'); ?>
<?php endwhile; ?>
<div class="clear"></div>
<?php enif; ?>
Class Reference/WP Query « WordPress Codex
en ese link explican todo con respecto a las querys de wordpress, dale una leída y tendrás más que suficiente 🙂
Como te dicen, debes modificar el archivo home.php del theme que estas usando (si no existe lo creas copiando y pegando el contenido de index.php) y hacer una custom query.
Tambien deberias agregar un link al archive para que los visitantes tengan acceso al listado completo de notas.
Para lo de limitar los posts, en tu home.php justo antes del loop principal (donde se listan los post), pones esto:
PHP:query_posts(array( 'showposts' => 5, ));
Deberia quedarte algo similar a esto:
PHP:<?php query_posts(array( 'showposts' => 5, )); ?> <?php if ( have_posts() ) : ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part('content', 'booklisting'); ?> <?php endwhile; ?> <div class="clear"></div> <?php enif; ?>
<?php
query_posts(array(
'showposts' => 5,
));
?>
<?php if ( have_posts() ) : ?>
query_posts(array(
****'showposts'*=>*5,
));*
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: Template Hierarchy « WordPress Codex
*
* @package Graphene
* @since Graphene 1.0
*/
global $graphene_settings;
get_header(); ?>
<div class="entries-wrapper">
<?php
do_action('graphene_index_pre_loop');
/* Run the loop to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-index.php and that will be used instead.
*/
while ( have_posts() ) {
the_post();
get_template_part( 'loop', 'index' );
}
?>
</div>
<?php graphene_posts_nav(); ?>
<?php get_footer(); ?>
Esos cambios se hacen en el index.php cuando el amigo dijo home, se refería a ese archivo.
una wp_query custom es un consulta a la base de datos para traer cierto tipo de posts, con varios indicadores.
puedes decirle cuantos mostrar, de que fecha, si son posts, páginas, custom_posts_types, puedes decirle a partir de cual quieres que te muestre, que categoria, etc. etc. etc.
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: Template Hierarchy « WordPress Codex
*
* @package Graphene
* @since Graphene 1.0
*/
global $graphene_settings;
get_header(); ?>
<div class="entries-wrapper">
<?php
do_action('graphene_index_pre_loop');
/* Run the loop to output the posts.
* If you want to overload this in a child theme then include a file
* called loop-index.php and that will be used instead.
*/
query_posts(array(
'showposts' => 5,
));
while ( have_posts() ) {
the_post();
get_template_part( 'loop', 'index' );
}
?>
</div>
<?php graphene_posts_nav(); ?>
<?php get_footer(); ?>
No confundas por favor.
Utilizamos cookies y tecnologías similares para los siguientes fines:
¿Aceptas las cookies y estas tecnologías?
Utilizamos cookies y tecnologías similares para los siguientes fines:
¿Aceptas las cookies y estas tecnologías?