Support » Themes and Templates » Visitor can choose post sorting

  • Hi everyone,

    So, I would like my visitors can choose to sort the posts by date descending or title ascending when he click on a simple link “Date” or “A-Z”.

    But i’ve got two different post design …
    Like this for “By Date”

    <?php if(have_posts()) : ?>
    		<?php while(have_posts()) : the_post(); ?>
    		<div class="ContentTrack" id="Track-<?php the_ID(); ?>">
    			 <a href="<?php the_permalink(); ?>">
    				<?php dp_attachment_image($post->ID, 'thumbnail', 'alt="' . $post->post_title . '"'); ?></a>
    		</div>
    		<?php endwhile; ?>
    			<?php posts_nav_link(' - ','page suivante','page précédente'); ?>
    		<?php else : ?>
    		<?php endif; ?>

    And like this for “By Title”

    [Code moderated as per the Forum Rules. Please use the pastebin]

    It’s very similar, just adding a letter for each group when is sort by alphabetical.
    I have no idea how I can do this “selector” ? Can someone help me? Guide me?

    Thanks you very much for everything.

  • The topic ‘Visitor can choose post sorting’ is closed to new replies.