Title: cosimo's Replies | WordPress.org

---

# cosimo

  [  ](https://wordpress.org/support/users/cosimoamicagmailcom/)

 *   [Profile](https://wordpress.org/support/users/cosimoamicagmailcom/)
 *   [Topics Started](https://wordpress.org/support/users/cosimoamicagmailcom/topics/)
 *   [Replies Created](https://wordpress.org/support/users/cosimoamicagmailcom/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/cosimoamicagmailcom/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/cosimoamicagmailcom/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/cosimoamicagmailcom/engagements/)
 *   [Favorites](https://wordpress.org/support/users/cosimoamicagmailcom/favorites/)

 Search replies:

## Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [wp_query and pagination](https://wordpress.org/support/topic/wp_query-and-pagination-1/)
 *  Thread Starter [cosimo](https://wordpress.org/support/users/cosimoamicagmailcom/)
 * (@cosimoamicagmailcom)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/wp_query-and-pagination-1/#post-2719153)
 * excuse me in the previous post i write wrong code:
 *     ```
       next_posts_link('Next posts', $my_query->max_num_pages);
       previous_posts_link('Previous posts', $my_query->max_num_pages);
       ```
   
 * this is the exact code for pagination:
 *     ```
       next_posts_link('Next posts', $my_query->max_pages);
       previous_posts_link('Previous posts', $my_query->max_pages);
       ```
   
 * it was just a digitation error.
 * _[ Please do not bump. It’s [not permitted here](http://codex.wordpress.org/Forum_Welcome#No_Bumping).]_
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Wrong multiple queries using get_posts](https://wordpress.org/support/topic/wrong-multiple-queries-using-get_posts/)
 *  Thread Starter [cosimo](https://wordpress.org/support/users/cosimoamicagmailcom/)
 * (@cosimoamicagmailcom)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wrong-multiple-queries-using-get_posts/#post-2563941)
 * HI, i use your code and now it works fine, thank you.
    But I can not understand
   why the other code does not work, it seems to be correct. I wish I could understand
   where the error is.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Wrong multiple queries using get_posts](https://wordpress.org/support/topic/wrong-multiple-queries-using-get_posts/)
 *  Thread Starter [cosimo](https://wordpress.org/support/users/cosimoamicagmailcom/)
 * (@cosimoamicagmailcom)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wrong-multiple-queries-using-get_posts/#post-2563794)
 * No one can help me? This is my loop
 *     ```
       <div class="travel_box_container">
              	<h3>Viaggi e crociere in primo piano</h3>
               	<?php
       			$args = array( 'numberposts' => 6, 'category' => '7', 'order'=> 'ASC', 'orderby' => 'title' );
       			$postslist = get_posts( $args );
       			foreach ($postslist as $post) :  setup_postdata($post);
       			?>
               	<div class="travel_box">
               		<a href="<?php the_permalink() ?>" title="Vedi <?php the_title_attribute(); ?>">
                       <? the_post_thumbnail() ?></a>
               		<h4><?php the_title(); ?></h4>
                   	<?php the_excerpt(); ?>
                   	<div class="details"><p><a href="<?php the_permalink() ?>" title="Vedi e prenota <?php the_title_attribute(); ?>">Vedi e prenota</a></p></div>
               		<div class="travel_box_angle">
                   		<p>A partire da <span><?php echo get_post_meta($post->ID, 'prezzo_base', true) ?></span></p>
                   	</div><!--chiusura di un angolo prezzo -->
               	</div><!-- chiusura di un travel box -->
                   <?php endforeach; ?>
                   <?php wp_reset_query();?>
                   <div style="clear:both;"></div>
           </div><!-- chiusura di travel box container con i viaggi in primo piano-->
           <div style="clear:both;"></div>
           	<div class="bottom_wrapper">
               	<h3>Viaggi e crociere in offerta</h3>
               	<div class="bottom_wrapper_scroller">
                   	<?php
       				$args2 = array( 'numberposts' => 4, 'category' => '5', 'order'=> 'ASC', 'orderby' => 'title' );
       				$postslist2 = get_posts( $args2 );
       				foreach ($postslist2 as $post2) :  setup_postdata($post2);
       				?>
               		<div class="bottom_box">
                   		<a href="<?php the_permalink() ?>" title="Vedi <?php the_title_attribute(); ?>">
                           <? the_post_thumbnail(); ?></a>
                       	<h4><?php the_title(); ?></h4>
                       	<?php the_excerpt(); ?>
                       	<div class="details"><p><a href="<?php the_permalink(); ?>" title="Vedi e prenota <?php the_title_attribute(); ?>">Vedi e prenota</a></p></div>
                       	<div class="travel_box_angle">
                   			<p>A partire da <span><?php echo get_post_meta($post->ID, 'prezzo_base', true) ?></span></p>
                   		</div><!--chiusura di un angolo prezzo -->
                   	</div><!-- chiusura di un bottom box -->
                       <?php endforeach; ?>
                       <?php wp_reset_query();?>
                       <div class="bottom_box_clear"></div>
               	</div><!-- chiusura di bottom wrapper scroller -->
                </div><!-- chiusura del bottom wrapper con i viaggi in offerta-->
                <div class="bottom_wrapper">
               	<h3>Viaggi e crociere <span class="red_title">last minute</span></h3>
                   	<div class="bottom_wrapper_scroller">
                			<?php
       					$args3 = array( 'numberposts' => 4, 'category' => '6', 'order'=> 'ASC', 'orderby' => 'title' );
       					$postslist3 = get_posts( $args3 );
       					foreach ($postslist3 as $post3) :  setup_postdata($post3);
       					?>
                       	<div class="bottom_box">
                   			<a href="<?php the_permalink() ?>" title="Vedi <?php the_title_attribute(); ?>">
                           	<? the_post_thumbnail() ?></a>
                       		<h4><?php the_title(); ?></h4>
                       		<?php the_excerpt(); ?>
                       		<div class="details"><p><a href="<?php the_permalink(); ?>" title="Vedi e prenota <?php the_title_attribute(); ?>">Vedi e prenota</a></p></div>
                       		<div class="travel_box_angle">
                   				<p>A partire da <span><?php echo get_post_meta($post->ID, 'prezzo_base', true) ?></span></p>
                   			</div><!--chiusura di un angolo prezzo -->
                   		</div><!-- chiusura di un bottom box -->
                           <?php endforeach; ?>
                           <?php wp_reset_query();?>
                       	<div class="bottom_box_clear"></div>
               		</div><!-- chiusura di bottom wrapper scroller -->
               </div><!-- chiusura del secondo bottom wrapper con i last minute-->
       ```
   
 * Seems there’s nothing wrong, but it dont’t work.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Wrong multiple queries using get_posts](https://wordpress.org/support/topic/wrong-multiple-queries-using-get_posts/)
 *  Thread Starter [cosimo](https://wordpress.org/support/users/cosimoamicagmailcom/)
 * (@cosimoamicagmailcom)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/wrong-multiple-queries-using-get_posts/#post-2563783)
 * Yes it’s the first thing i do, but not work.
 *   Forum: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
   
   In reply to: [meta box custom fields with images uploader](https://wordpress.org/support/topic/meta-box-custom-fields-with-images-uploader/)
 *  Thread Starter [cosimo](https://wordpress.org/support/users/cosimoamicagmailcom/)
 * (@cosimoamicagmailcom)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/meta-box-custom-fields-with-images-uploader/#post-1918883)
 * I solved with this:
 *     ```
       jQuery(document).ready(function () {
       jQuery('#bottone_carica_anteprima').click(function () {
       formfield = jQuery('#carica_anteprima');
       post_id = jQuery('#post_ID').val();
       tb_show('', 'media-upload.php?post_id=' + post_id + '&type=image&TB_iframe=true');
       return false;
       });
       window.send_to_editor = function (html) {
       imgurl = jQuery('img', html).attr('src');
       jQuery('#carica_anteprima').val(imgurl);
       tb_remove();
       }
       jQuery('#bottone_carica_foto').click(function () {
       formfield = jQuery('#carica_foto');
       post_id = jQuery('#post_ID').val();
       window.send_to_editor = window.send_to_editor_clone;
       tb_show('', 'media-upload.php?post_id=' + post_id + '&type=image&TB_iframe=true');
       return false;
       });
       window.send_to_editor_clone = function (html) {
       imgurl = jQuery('img', html).attr('src');
       jQuery('#carica_foto').val(imgurl);
       tb_remove();
       }
       });
       ```
   
 * Found [here](http://www.webmaster-source.com/2010/01/08/using-the-wordpress-uploader-in-your-plugin-or-theme/)

Viewing 5 replies - 1 through 5 (of 5 total)