Forums

v2.8 has broken multiple loops - helppp! (5 posts)

  1. insidebigbro
    Member
    Posted 9 months ago #

    Okay so here's the deal, I have a portion in my header which is pulled from a wp_query:

    <?php $my_query2 = new WP_Query('category_name=Elements&showposts=1'); ?>
    <?php while ($my_query2->have_posts()) : $my_query2->the_post(); ?>
    <div id="stats"> <!-- open stats -->
    <?php the_content(); ?>
    <div class="clear"></div><?php rewind_posts(); ?>
    </div><?php endwhile; ?> <!-- close stats -->

    This works fine on all posts and the homepage, but royally messes up my Pages. Two things don't work on my Pages, which are pulled from a specific Page Template
    <img id="hmimage" src="<?php bloginfo('url'); ?>/<?php echo get_post_meta($post->ID, "avatar", true); ?>.jpg" alt="" />
    For this, get_post_meta fails due to the wp_query in the stats. Meanwhile, a wp_query on the Page in the template also fails to bring up anything when the code in the header is in place.

    Any ideas how I can fix this? It worked in 2.7.

  2. insidebigbro
    Member
    Posted 9 months ago #

    Please help!

  3. BVBAccelerate
    Member
    Posted 8 months ago #

    I'm going to bump this because I'm looking for a solution to this too. I'm sure there has to be something. I don't think the people at wordpress would release a new version of their software which would not allow such an important feature to work.

    Please help!

  4. othellobloke
    Member
    Posted 8 months ago #

    What's your url?

  5. othellobloke
    Member
    Posted 8 months ago #

    If I understand you right... each page you've uploaded an image and put the name of the image into a custom field called 'avatar'?

Reply

You must log in to post.

About this Topic

Tags

No tags yet.