0

Alright.. I've been looking alot on the internet in search of a solution for this.. so far i found nothing that could explain me how to solve it..

When i click on Page suivant from the navigation div all it does is redirecting me to home page instead of loading the same page and showing the next 12 post from 'bateaux' which has 18 posts in it.

<?php 

            $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;

            $args = array(
                'post_type' => 'bateaux',
                'post_status' => 'publish',
                'orderby' => 'menu_order',
                'posts_per_page' => 12,
                'caller_get_posts' => 1,
                'paged' => $paged
            );

            query_posts($args);

            while (have_posts()): the_post();

            $attachment_id = get_field('image_supplementaire_1'); 
            $image_attributes = wp_get_attachment_image_src( $attachment_id );  

        ?>

        <li class="grid_3 alpha omega">
            <?php

                if ($attachment_id != NULL)
                {

            ?>
                <a href="<?php echo add_query_arg( 'action', 'Consulter', the_permalink()); ?>" title="<?php the_field('titre'); ?>"><img alt="<?php the_field('titre'); ?>" src="<?php echo $image_attributes[0]; ?>" width="155px" height="133px" /></a>
            <?php

                }
                else 
                {

            ?>
                <a href="<?php echo add_query_arg( 'action', 'Consulter', the_permalink()); ?>" title="<?php the_field('titre'); ?>"><img alt="<?php the_field('titre'); ?>" src="<?php bloginfo( 'template_directory' ); ?>/Images/img_default.jpg" width="155px" height="133px" /></a>
            <?php

                }

            ?>
            <p class="titreDetail"><?php the_field('titre'); ?></p>
            <p><span><?php the_field('prix'); ?>$</span></p>
            <a href="<?php add_query_arg( 'action', 'Consulter', the_permalink()); ?>" class="details" title="Détails" >Détails</a>
        </li>

       <?php

            endwhile; 

        ?>

        <div class="navigation">
            <div class="alignleft"><?php previous_posts_link('&laquo; Page pr&eacute;c&eacute;dente') ?></div>
            <div class="alignright"><p><?php next_posts_link('Page suivante &raquo;') ?></p></div>
        </div>  

    </ul>

    <?php

        wp_reset_query();

    ?>

Any tips ?

Thks!

2
  • Please see the solution here Commented Oct 29, 2013 at 15:38
  • thks anyway! but i didnt manage to get it to works.
    – pouki
    Commented Oct 29, 2013 at 18:33

0

Browse other questions tagged or ask your own question.