Loop inside a loop (loopception?) problem :(
-
Hey guys,
I’m new to the whole wordpress thing, and it’s my first time designing a theme and I have a problem.
On a page I need to show post of a specific category and an other post from a different category, the first category is used on other pages and that specific page should show the title, the meta and a contact form on generated by “contact form 7” which is on a post with it’s own category.I can’t get it to work, I tried a bunch of things, here is the latest:
<?php function tarifs() { $temp_query = $wp_query; query_posts('category_name=contact-tarif'); if(have_posts()): while(have_posts()): the_post(); the_content(); endwhile; endif; } ?> <?php $temp_query = $wp_query; ?> <?php query_posts('category_name=techniques'); ?> <?php //verifier articles ou non ? if(have_posts()): // tend q'on recois des articles while(have_posts()): the_post(); $thumb_id = get_post_thumbnail_id(); $thumb_url_array = wp_get_attachment_image_src($thumb_id, 'large', true); $thumb_url = $thumb_url_array[0]; ?> <section class="parallax-2 module parallax parallax-single parallax-tarifs" style="background-image: url('<?php echo $thumb_url?>')" > <div class="container"> <h2 class="tarifs"><?php the_title();?></h2> <div class="left-right"> <div class="tarifs-left"> <?php $prix = get_post_meta( get_the_ID(), 'Prix' ); echo '<p class="h2 prix">'.$prix[0].'</p><br />'; $dure = get_post_meta( get_the_ID(), 'Durée' ); echo '<p class="h2 duree">'.$dure[0].'</p>'; ?> </div> <div class="tarif-right"><?php tarifs(); ?></div> </div> </div> </section> <?php endwhile; endif; ?>
Would really appreciate if you could help me out :/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Loop inside a loop (loopception?) problem :(’ is closed to new replies.