372 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
mrjasmin says

Hi! I´m having a little problem with my wordpress theme. I want to use query_posts on my theme, but when I add query_posts before the loop, than the page gets all white and everuthing on the page disappears. I´m using this before my loop.

How do i solve this problem ?

Here is my code :

<?php query_posts(‘category_name=Portfolio’); ?>

<?php if(have_posts()) : ?>

&lt;?php while(have_posts()): the_post(); ?&gt;

<?php the_title(); ?>

Posted in <?php the_category(’, ‘); ?> <?php the_date(); ?> <?php the_excerpt(); ?> <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ’% Comments »’); ?> <?php endwhile; ?> <?php if(function_exists(‘wp_paginator’)) { wp_paginator(); } ?> <?php else: ?>

Could not find any blogpost

<? endelse <?php endif ; ?>
751 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
CyberShot says

try using the category id instead of the name like this

queryposts(‘cat=category number goes here’);

by
by
by
by
by
by