372 posts
  • 6 Years of Membership
  • Author Level 3
  • Collector Level 2
  • Exclusive Author
+2 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. Everything else works just fine on the theme before i add the query_posts.

How do i solve this problem ?

Here is my code :

http://pastie.org/441664

372 posts
  • 6 Years of Membership
  • Author Level 3
  • Collector Level 2
  • Exclusive Author
+2 more
mrjasmin
says

Nobody ?

204 posts Bold WordPress Theme Development
  • 6 Years of Membership
  • Affiliate Level 5
  • Author Level 9
  • Blog Interview
+7 more
srhnbr
says

Try having the ‘if have posts’ first then ‘query posts’ then ‘while have posts’ and be careful with how you end your loop.

So you’ll have:

if..

query..
while...
endwhile...

else..

endif

hope that makes sense

372 posts
  • 6 Years of Membership
  • Author Level 3
  • Collector Level 2
  • Exclusive Author
+2 more
mrjasmin
says
Try having the ‘if have posts’ first then ‘query posts’ then ‘while have posts’ and be careful with how you end your loop.

So you’ll have:

if..

query..
while...
endwhile...

else..

endif

hope that makes sense

Still not working….

171 posts
  • Affiliate Level 4
  • Author Level 5
  • Collector Level 4
  • Top Monthly Author
+6 more
clarklab
says

When you use query_posts it affects the loops that come after it. You need to preserve the original loop if you still want to use it. Look up info about rewind_posts(), that should help…

372 posts
  • 6 Years of Membership
  • Author Level 3
  • Collector Level 2
  • Exclusive Author
+2 more
mrjasmin
says

Still not working, i will pay the one who helps me solve the problem.

171 posts
  • Affiliate Level 4
  • Author Level 5
  • Collector Level 4
  • Top Monthly Author
+6 more
clarklab
says

Oh, I read that wrong. I thought you meant the query_posts was working but ruining the rest of the page.

Here is the exact snippet from my template that shows how I do it. I don’t have time to troubleshoot your code, but if you compare it to this you should be able to find the problem:

http://pastie.org/441977

(it looks like you dont both need IF have post and WHILE have posts)

260 posts
  • 6 Years of Membership
  • Author Level 10
  • Collector Level 2
  • Elite Author
+6 more
BuchmannDesign
says

The end of your code looks unusual:

<? endelse <?php endif ; ?>

First, you don’t have a closing php code after “endelse”.

Second, i have issues with php code if i use ”<?” instead of ”<?php”. Try using ”<?php” before the endelse.

I charge $1000.00 per incident! :)

372 posts
  • 6 Years of Membership
  • Author Level 3
  • Collector Level 2
  • Exclusive Author
+2 more
mrjasmin
says

It´s not working. Is there anybode that can help me ? That can take a look in my files ? I will pay 10 $.

372 posts
  • 6 Years of Membership
  • Author Level 3
  • Collector Level 2
  • Exclusive Author
+2 more
mrjasmin
says

Anyone ? I will pay.

by
by
by
by
by
by