Forums

modifying the page template to be a standalone that pulls entries (1 post)

  1. reese
    Member
    Posted 6 years ago #

    Hi there,
    Was reading this thread:
    http://wordpress.org/support/topic/25168

    And I used the default kubrick theme's page template and modified it to fit my design. However, the problem I'm having is the page itself is showing entries from my "write page" entry, NOT from my blog entries.

    Here's what I'm trying to do:
    Create a standalone page separate from the index that basically acts like a second blog. It will pull posts ONLY from a designated category.

    I need to be able to "link" to this page from a navigational menu. My nav item will say "past wines" and I need to be able to link directly to a page that is pulling WP info.

    Here is how my code looks on the page.php template: (I have omitted extraneous stuff for brevity)

    <?php

    get_header();

    ?>

    <?php if ( have_posts() ) : query_posts($query_string .'&cat=-2'); while ( have_posts() ) : the_post(); ?>
    <h2><?php the_title(); ?></h2>
    <?php the_content(); ?>

    <?php endwhile; else: ?>

    <?php _e('Sorry, no posts matched your criteria.'); ?>

    <?php endif; ?>

    <?php get_footer(); ?>

    So, it's basically like my index template, which works, except it's excluding a different cateogory.

    So my question is:
    1. How can I get it to NOT show any information from "pages" (e.g. title, content, etc) and instead just show actual blog entries?

    2. Will I be able to utilize a sidebar on for this that lists archives ONLY for category I want? And can I make it so that archive listing "knows" to utilize the page.php template rather than index.php?

    I need to use the page template to do this so I can link directly to it using a url like http://sitename.com/wp/?page_id=7 or else I would consider using something like category.php (unless someone knows how I can link directly to category php without it coming from a link within the index loop? I've tried, to no avail :(

    Thanks, and I hope this wasn't too confusing. I cannot link to examples of what I'm working on because it's for a commercial client whose work is still under wraps. I appreciate any help very much :)

Topic Closed

This topic has been closed to new replies.

About this Topic