• Hi, Folks!

    I’m an extremely determined newbie and I’ve managed to figure out just enough to get myself in trouble.

    What I’m trying to do is –

    1) Have a tabbed panel display on one of my pages. This requires multiple loops – I think. Got that working. I save the wp_query to a variable and then start a new $wp_query for each loop, resetting it to the original query and starting again in each loop.

    2) Each of the tabs (loops) has a different section of reviews. I have child categories of a main Reviews category in each tab content section. Each of these posts has custom fields for picture and star rating.

    3) I’m trying to query the post for the custom field and use a simple series of if statements to assign a star rating image of 1-5 stars under each image. This variable is then inserted into an echo statement passed to TimThumb, to be re-sized.

    What’s happening is – the query is getting the pictures for each individual post, no problem, but when it comes to the star-rating image, it’s getting just the first one from the very first post in the very first loop and applying that to all of them.

    I’m going crazy with this and I wonder if someone might have run into this before. Maybe I’m just boneheaded on my code, I don’t know. That’s quite likely.

    If someone out there knows how to do this, could you please type a few lines of code on how you would do it? Including where the queries are reset for the loop, since it happens multiple times? It would be much, much appreciated!

    Thanks for listening. 🙂

Viewing 1 replies (of 1 total)
  • Thread Starter quantum0d0

    (@quantum0d0)

    PS – What I’m wondering is if maybe, because my star_rating custom field is a number . . . well, do I have to handle it is a string or a number in my if statements? The php web site seems to indicate I’d handle a single entry field as a string, but . . . Something just tells me I’m passing the variable incorrectly – as a numeric value instead of a string – and maybe that’s causing the problem.

Viewing 1 replies (of 1 total)
  • The topic ‘Querying custom fields, sending to TimThumb, multiple loops, tabbed panels’ is closed to new replies.