Title: This code doesnt show my post.
Last modified: August 19, 2016

---

# This code doesnt show my post.

 *  [cloudstr210](https://wordpress.org/support/users/cloudstr210/)
 * (@cloudstr210)
 * [15 years ago](https://wordpress.org/support/topic/this-code-doesnt-show-my-post/)
 * Hello, im trying to customize the theme that i downloaded on the internet..
 * The categories of the post are posted like this:
 *     ```
       <?php if(!is_paged()) { ?>
   
       	<div id="middle" class="clearfloat">
       	<img src="<?php bloginfo('template_url'); ?>/images/category.png" class="clearfloat" alt="" />
       	<?php $display_categories = array(1,46,48,49,50); $i = 1;
       	foreach ($display_categories as $category) { ?>
   
       	<div id="cat-<?php echo $i; ?>" class="category" onclick="window.location.href='<?php echo get_category_link($category);?>'" >
       		<?php query_posts("showposts=1&cat=$category")?>
       		<?php if (is_category($category)) { ?>
       		<span class="cat_title"><?php single_cat_title(); ?></span>
   
       		<?php echo category_description($category);  } ?>
       	</div>
   
       	<?php $i++; ?>
           	<?php } ?>
   
       	</div>
       ```
   
 * and this not show up on the single post and pages.. now im trying to put it on
   single and pages.. but when i tried to paste it the home page is working but 
   when i click on the title of the topics, the single post said that “Sorry, no
   posts matched your criteria.”
 * but when i removed it again. the post showed up..
 * Thanks!

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

 *  Thread Starter [cloudstr210](https://wordpress.org/support/users/cloudstr210/)
 * (@cloudstr210)
 * [15 years ago](https://wordpress.org/support/topic/this-code-doesnt-show-my-post/#post-2054045)
 * Another thing..
 * The post showed up when i try to remove the
 *     ```
       <?php query_posts("showposts=1&cat=$category")?>
       ```
   
 * Thanks!
 *  Thread Starter [cloudstr210](https://wordpress.org/support/users/cloudstr210/)
 * (@cloudstr210)
 * [15 years ago](https://wordpress.org/support/topic/this-code-doesnt-show-my-post/#post-2054053)
 * What item can i replace with this item to make it work?
 * `<?php query_posts("showposts=1&cat=$category")?>`
 * Thank you.
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years ago](https://wordpress.org/support/topic/this-code-doesnt-show-my-post/#post-2054223)
 * > but when i tried to paste it the home page is working but when i click on the
   > title of the topics, the single post said that “Sorry, no posts matched your
   > criteria.”
 * is tath the only output you get on the single post?
    or is the single post still
   there, but no output from the above?
 * can you paste the full code of the template into a [http://pastebin.com/](http://pastebin.com/)
   and post the link to it here?
 * link to your site?

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

The topic ‘This code doesnt show my post.’ is closed to new replies.

 * 3 replies
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/this-code-doesnt-show-my-post/#post-2054223)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
