0

I want to use the offset function to skip the first post and I have this code inside which I need to put an offside=1 , but wherever I insert it, I receive the error...any idea where I can add it inside this code below?

<?php 
$recent = new WP_Query( array( 
    'tag' => get_option('gd_slider_tags'), 
    'showposts' => get_option('gd_slider_num')) 
); 
while($recent->have_posts()) : $recent->the_post();?>
  • 2
    have you really been using offside instead of offset? – anu Aug 3 '13 at 19:21
  • Lol , no i just seen this ...i m tired and the english is not my first languange, and i m watching a game.Once again , thanks – Max Aug 3 '13 at 19:57
1
<?php 
$recent = new WP_Query( array( 
    'tag' => get_option('gd_slider_tags'), 
    'posts_per_page' => get_option('gd_slider_num'),
    'offset' => 1) 
); 
while($recent->have_posts()) : $recent->the_post();?>
  • showposts is deprecated – JMau Aug 3 '13 at 19:25
  • I was going to say : Parse error: syntax error, unexpected T_DOUBLE_ARROW ...still nothing..then i see you edited, and the new code works.Thanks – Max Aug 3 '13 at 19:25
  • @JMa - good spot, fixed. – anu Aug 4 '13 at 1:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.