I need some help
I want to list all post from a meta_key, order by meta_value in ASC order All this in 1 toogle jquery.
I've this:
<div id="box-temp" class="gray-shadow">
<!-- First Loop -->
<h3 class="titulo-temp"> NUMBER OF FIRST LOOP </h3>
<hr>
<ul class="items-temp">
<?php query_posts('meta_key=numeroepisodio&orderby=meta_value&order=ASC'); ?>
<?php while (have_posts()) : the_post(); ?>
<?php $numeroepisodio = get_post_meta($post->ID, 'numeroepisodio',true);?>
<a href="<?php the_permalink() ?>"><li>
<strong><?php echo 'Episodio '.$numeroepisodio; ?>:</strong> <?php the_title(); ?> <img src="//cdn.enlatino.net/img/play.png" class="img-play">
</li></a>
<?php endwhile; ?>
<hr class="no-top">
</ul>
<!-- Second Loop -->
<h3 class="titulo-temp"> NUMBER OF SECOND LOOP </h3>
<hr>
<ul id="items-temp1" class="items-temp">
<?php query_posts('meta_key=numeroepisodio&orderby=meta_value&order=ASC'); ?>
<?php while (have_posts()) : the_post(); ?>
<?php $numeroepisodio = get_post_meta($post->ID, 'numeroepisodio',true);?>
<a href="<?php the_permalink() ?>"><li>
<strong><?php echo 'Episodio '.$numeroepisodio; ?>:</strong> <?php the_title(); ?> <img src="//cdn.enlatino.net/img/play.png" class="img-play">
</li></a>
<?php endwhile; ?>
<hr class="no-top">
</ul>
</div><!-- Fin Box-Temp -->
What i want to show:
All loops: http://prntscr.com/62fn5l
The loop in action: http://prntscr.com/62fmvv
Its advisable to save the post in a category to show and control this better?
Sorry for my english i'm from Argentina.
Thanks to read.
query_posts
, it will break a lot of things on your page. If you have to use a custom query, useWP_Query
instead. Also, you have to reset every custom loop if you setup the loop or postdata. Go back, rewrite your code to useWP_Query
and addwp_reset_postdata()
after every loop