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 6 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’);

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by