Buenas a todos foreros!
He estado creando un theme en wordpress personalizado para algo bastante importante y me he quedado parado en una parte. Explico mas.
Aclaro que esta web tiene que llevar si o si un blog, o una pagina donde se muestren las entradas publicadas del WP.
- Ya tengo modificado los archivos header.php, footer.php y functions.php, Piece of cake!
- En el archivo index.php se muestra una landing page, donde se explican los servicios, precios, etc.
- He creado una pagina en wordpress que lleva por nombre Blog(Se supone que aquí se muestran las entradas/artículos) y ademas he creado el siguiente archivo page-blog.php con el siguiente código(tomado de un theme básico):
Pero al momento de ir a sitio.com/blog no me muestra ni una sola entrada.
¿Alguien sabe a que se debe esto? ¿Como puedo mostrar las entradas en la pagina personalizada llamada Blog?
PD: Permiso, cito a @lobogris
He estado creando un theme en wordpress personalizado para algo bastante importante y me he quedado parado en una parte. Explico mas.
Aclaro que esta web tiene que llevar si o si un blog, o una pagina donde se muestren las entradas publicadas del WP.
- Ya tengo modificado los archivos header.php, footer.php y functions.php, Piece of cake!
- En el archivo index.php se muestra una landing page, donde se explican los servicios, precios, etc.
- He creado una pagina en wordpress que lleva por nombre Blog(Se supone que aquí se muestran las entradas/artículos) y ademas he creado el siguiente archivo page-blog.php con el siguiente código(tomado de un theme básico):
Código:
<?php
/**[/FONT]
[FONT=Tahoma] * The template for displaying the home/index page.[/FONT]
[FONT=Tahoma] * This template will also be called in any case where the Wordpress engine [/FONT]
[FONT=Tahoma] * doesn't know which template to use (e.g. 404 error)[/FONT]
[FONT=Tahoma] */[/FONT]
[FONT=Tahoma]get_header(); // This fxn gets the header.php file and renders it ?>[/FONT]
[FONT=Tahoma] <div id="primary" class="row-fluid">[/FONT]
[FONT=Tahoma] <div id="content" role="main" class="span8 offset2">[/FONT]
[FONT=Tahoma] <?php if ( have_posts() ) : [/FONT]
[FONT=Tahoma] // Do we have any posts in the databse that match our query?[/FONT]
[FONT=Tahoma] // In the case of the home page, this will call for the most recent posts [/FONT]
[FONT=Tahoma] ?>[/FONT]
[FONT=Tahoma] <?php while ( have_posts() ) : the_post(); [/FONT]
[FONT=Tahoma] // If we have some posts to show, start a loop that will display each one the same way[/FONT]
[FONT=Tahoma] ?>[/FONT]
[FONT=Tahoma] <article class="post">[/FONT]
[FONT=Tahoma] <h1 class="title">[/FONT]
[FONT=Tahoma] <a href="<?php the_permalink(); // Get the link to this post ?>" title="<?php the_title(); ?>">[/FONT]
[FONT=Tahoma] <?php the_title(); // Show the title of the posts as a link ?>[/FONT]
[FONT=Tahoma] </a>[/FONT]
[FONT=Tahoma] </h1>[/FONT]
[FONT=Tahoma] <div class="post-meta">[/FONT]
[FONT=Tahoma] <?php the_time('m/d/Y'); // Display the time published ?> | [/FONT]
[FONT=Tahoma] <?php if( comments_open() ) : // If we have comments open on this post, display a link and count of them ?>[/FONT]
[FONT=Tahoma] <span class="comments-link">[/FONT]
[FONT=Tahoma] <?php comments_popup_link( __( 'Comment', 'break' ), __( '1 Comment', 'break' ), __( '% Comments', 'break' ) ); [/FONT]
[FONT=Tahoma] // Display the comment count with the applicable pluralization[/FONT]
[FONT=Tahoma] ?>[/FONT]
[FONT=Tahoma] </span>[/FONT]
[FONT=Tahoma] <?php endif; ?>[/FONT]
[FONT=Tahoma] </div><!--/post-meta -->[/FONT]
[FONT=Tahoma] <div class="the-content">[/FONT]
[FONT=Tahoma] <?php the_content( 'Continue...' ); [/FONT]
[FONT=Tahoma] // This call the main content of the post, the stuff in the main text box while composing.[/FONT]
[FONT=Tahoma] // This will wrap everything in p tags and show a link as 'Continue...' where/if the[/FONT]
[FONT=Tahoma] // author inserted a <!-- more --> link in the post body[/FONT]
[FONT=Tahoma] ?>[/FONT]
[FONT=Tahoma] <?php wp_link_pages(); // This will display pagination links, if applicable to the post ?>[/FONT]
[FONT=Tahoma] </div><!-- the-content -->[/FONT]
[FONT=Tahoma] <div class="meta clearfix">[/FONT]
[FONT=Tahoma] <div class="category"><?php echo get_the_category_list(); // Display the categories this post belongs to, as links ?></div>[/FONT]
[FONT=Tahoma] <div class="tags"><?php echo get_the_tag_list( '| ', ' ' ); // Display the tags this post has, as links separated by spaces and pipes ?></div>[/FONT]
[FONT=Tahoma] </div><!-- Meta -->[/FONT]
[FONT=Tahoma] </article>[/FONT]
[FONT=Tahoma] <?php endwhile; // OK, let's stop the posts loop once we've exhausted our query/number of posts ?>[/FONT]
[FONT=Tahoma] <!-- pagintation -->[/FONT]
[FONT=Tahoma] <div id="pagination" class="clearfix">[/FONT]
[FONT=Tahoma] <div class="past-page"><?php previous_posts_link( 'newer' ); // Display a link to newer posts, if there are any, with the text 'newer' ?></div>[/FONT]
[FONT=Tahoma] <div class="next-page"><?php next_posts_link( 'older' ); // Display a link to older posts, if there are any, with the text 'older' ?></div>[/FONT]
[FONT=Tahoma] </div><!-- pagination -->[/FONT]
[FONT=Tahoma] <?php else : // Well, if there are no posts to display and loop through, let's apologize to the reader (also your 404 error) ?>[/FONT]
[FONT=Tahoma] <article class="post error">[/FONT]
[FONT=Tahoma] <h1 class="404">Nothing has been posted like that yet</h1>[/FONT]
[FONT=Tahoma] </article>[/FONT]
[FONT=Tahoma] <?php endif; // OK, I think that takes care of both scenarios (having posts or not having any posts) ?>[/FONT]
[FONT=Tahoma] </div><!-- #content .site-content -->[/FONT]
[FONT=Tahoma] </div><!-- #primary .content-area -->[/FONT]
[FONT=Tahoma]<?php get_footer(); // This fxn gets the footer.php file and renders it ?>[/FONT]
Pero al momento de ir a sitio.com/blog no me muestra ni una sola entrada.
¿Alguien sabe a que se debe esto? ¿Como puedo mostrar las entradas en la pagina personalizada llamada Blog?
PD: Permiso, cito a @lobogris