Title: Page
Last modified: August 19, 2016

---

# Page

 *  [junkie06](https://wordpress.org/support/users/junkie06/)
 * (@junkie06)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/page-4/)
 * Hello,
    Can someone give me a code to have a specific page show a specific category
   only (cat id=35) thanks

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [buddha-trance](https://wordpress.org/support/users/buddha-trance/)
 * (@buddha-trance)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/page-4/#post-987963)
 * Make a template for that page, and use this code in the loop part.
    Create a 
   page, and in the attributes, select that template.
 *     ```
       <?php if(have_posts()) : ?>
       		<?php
          if (is_page()) {
             query_posts('cat=35');
          }
       ?>
   
       <?php while(have_posts()) : the_post(); ?>
       ```
   
 *  Thread Starter [junkie06](https://wordpress.org/support/users/junkie06/)
 * (@junkie06)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/page-4/#post-988017)
 * thanks so much
 *  Thread Starter [junkie06](https://wordpress.org/support/users/junkie06/)
 * (@junkie06)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/page-4/#post-988023)
 * i get this error message
 * Parse error: syntax error, unexpected $end in /home/behealthy/rawunfiltered.com/
   wp-content/themes/arthemia-premium/Blog.php on line 43
 * this is the template i made
 * <?php
    /* Template Name: blog */ ?>
 * <?php get_header(); ?>
 *  <div id=”content” class=”archive”>
 *  <?php if(have_posts()) : ?>
    <?php if (is_page()) { query_posts(‘cat=35’); }?
   >
 * <?php while(have_posts()) : the_post(); ?>
 *  <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
 *  <div class=”post” id=”post_<?php the_ID(); ?>”>
 *  » <?php the_title(); ?></span>
 *  <h2 class=”title”><?php the_title(); ?></h2>
 *  <div class=”entry” style=”padding-top:15px;”>
    <?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; ?>
 *  </div>
 * <?php get_sidebar(); ?>
    <?php get_footer(); ?>
 *  [iridiax](https://wordpress.org/support/users/iridiax/)
 * (@iridiax)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/page-4/#post-988027)
 * Review the [WordPress loop structure](http://codex.wordpress.org/The_Loop) and
   reduce your if (have_posts()) and while (have_posts()) to **one** each.
 *  Thread Starter [junkie06](https://wordpress.org/support/users/junkie06/)
 * (@junkie06)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/page-4/#post-988037)
 * Im not sure what you mean…i a newbie…
 * i did some changing and still get the error:
    Parse error: syntax error, unexpected
   $end in /home/behealthy/rawunfiltered.com/wp-content/themes/arthemia-premium/
   Blog.php on line 29
 * <?php
    /* Template Name: blog */ ?>
 * <?php get_header(); ?>
 *  <div id=”content” class=”archive”>
 *  <?php if(have_posts()) : ?>
    <?php if (is_page()) { query_posts(‘cat=35’); }?
   >
 *  » <?php the_title(); ?></span>
 *  <h2 class=”title”><?php the_title(); ?></h2>
 *  <div class=”entry” style=”padding-top:15px;”>
    <?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’)); ?>
 * <?php get_sidebar(); ?>
    <?php get_footer(); ?>
 *  [buddha-trance](https://wordpress.org/support/users/buddha-trance/)
 * (@buddha-trance)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/page-4/#post-988056)
 * I can’t download the premium theme, so I can’t look at the files.
 * In the “blog template”, replace the entire loop part. That is, between `<div 
   id="content">` and `<div class="post" id="post_<?php the_ID(); ?>">`
 * See if that works.
 * ‘<div id=”content” class=”archive”>
 * <?php if(have_posts()) : ?>
    <?php if (is_page()) { query_posts(‘cat=35’); } ?
   >
 * <?php while(have_posts()) : the_post(); ?>
 * <div class=”post” id=”post_<?php the_ID(); ?>”>`
 *  Thread Starter [junkie06](https://wordpress.org/support/users/junkie06/)
 * (@junkie06)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/page-4/#post-988080)
 * its giving me a line 23 error. line 23 is <?php get_footer(); ?>
    im not sure
   why
 * ps. cool website buddah
 *  [buddha-trance](https://wordpress.org/support/users/buddha-trance/)
 * (@buddha-trance)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/page-4/#post-988099)
 * There is something that looks odd here
    `<span id="map">/">Home » <?php the_title();?
   ></span>` It looks like a double closing tag, something is missing…
 * try
    `<span id="map">Home » <?php the_title(); ?></span>`
 * or double check the code that you copied and pasted into the template.
 * ps: thanks!
 *  Thread Starter [junkie06](https://wordpress.org/support/users/junkie06/)
 * (@junkie06)
 * [17 years, 2 months ago](https://wordpress.org/support/topic/page-4/#post-988144)
 * Did the above changes and checked the code I pasted….not sure why it keeps mentioning
   the last line error….
    I guess I’ll have to keep fiddling around till i get it…
   but thanks for your help 🙂

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Page’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 3 participants
 * Last reply from: [junkie06](https://wordpress.org/support/users/junkie06/)
 * Last activity: [17 years, 2 months ago](https://wordpress.org/support/topic/page-4/#post-988144)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
