WordPress.org

Support

Support » Installation » Loop in a template page

Loop in a template page

  • Hi,

    Im trying include a loop in my template page. I try it this:

    <?php
    /*
    Template Name: Mi pagina
    */
    ?>

    <?php get_header(); ?>

    <div id=”content”>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <div class=”entry”>
    <?php the_content(‘<p class=”serif”>Read the rest of this page »</p>’); ?>

    <?php wp_link_pages(array(‘before’ => ‘<p>Pages: ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>

    </div>
    </div>
    <?php endwhile; endif; ?>
    <?php edit_post_link(‘Edit this entry.’, ‘<p>’, ‘</p>’); ?>
    </div>

    <?php get_footer(); ?>

    But dont work…

    Please help me…

    Pd. Si alquien puede hacerlo en castellano le estare eternamente agradecido… saludos,

Viewing 4 replies - 1 through 4 (of 4 total)
  • You are trying to include a loop to display contents from one Page?

    I will point you to Pages, Page Templates for some more info.

    I have readed “Archives with Content”,

    http://codex.wordpress.org/Pages#Archives_with_Content

    it’s exactly to my page… but don’t work…

    The post are the same that the index page..

    What is not working?

    What is the exact name of the template file? Is that the template file you have assigned to the Page (in Manage->Pages for that Page, see the Page Template field)?

    Ok…

    Inserting:
    <?php query_posts($query); ?>

    Works correctly…

    But im trying display only specific post. The post ids are in a string (1,2,3,4,etc…) where numbers are posts ids.

    $post_ids = array(1,2,3,4);
    <?php query_posts(“p=$post_ids”); ?>

    Only display the first post id…

    Any idea…

    Thanks…

    Sorry but my english!!!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Loop in a template page’ is closed to new replies.
Skip to toolbar