How do I display the loop inside a static page? Like the loop when I use the search (which in this theme it’s actually working) or on index.php
An example for what I’m saying can be seen here: http://www.gaganews.com.br/noticias/ I want a page like this, showing all my posts with pagination, since my home page is kinda like the homepage here: http://www.gaganews.com.br/
I tried creating a template page, this way:
<?php
/*
Template Name: Noticias
*/
get_header(); ?>
<div id="loop"><?php if ( have_posts() ) : ?>
<?php
get_template_part( 'loop', 'index' );
?>
<?php endif; ?>
</div>
<div id="sidebar_single"><?php get_sidebar(); ?></div>
<?php get_footer(); ?>
I’m almost 100% sure that it’s not the right way, but that’s what I tried – like it was a “classic” index.php.
Then I created a blank page with this template, but with it instead of showing the latest posts on the page, it ONLY shows the PAGE TITLE itself: “News, posted on 1 de abril de 2013 by admin | Leave a comment | Edit” etc, but with all the CSS configuration from the loop (which means it’s actually calling it, right?).
What could I do to achieve what I’m looking for?
You could use
query_posts()
to set up a new loop in your page. Assuming that the posts you want are in the category ‘Noticias’, with a slug of ‘noticias’:You can simply use an iframe to wrap your query and place the iframe on any html or php page without having to touch your current page code…. See detail explanation on this link: http://allnigeriansinspain.com/blog/show-wordpress-post-on-static-html-page/