Can anyone tell me how I can add a switch button to the articles site, so that visitors are able to choose how the articles are displayed.
I want them to be ordered by name by default, but the user should be able to click on a button which says “Oder articles by date”. I think, that toggle button would do well, so you can always switch back to the default setting.
Would be very awesome if somebody could help me doing this.
Some details:
My menu only contains several categories, so the user clicks on a menu button and is forwarded to the post site where all the articles of that category are displayed. That page should contain the switch button.
Order the articles by:
<div class="btn-group" role="group" aria-label="...">
<button type="button" class="btn btn-default">Date</button>
<button type="button" class="btn btn-default">Name</button>
</div>
Thanks for your reply. I now found a solution which works fine for me, maybe there are better ways to do this but hey, it works.
For those, who are also searching a method to reach this, I’ll post my solution below.
First another question from my part. On the page, there are 10 articles which are displayed, the other articles can be found by a click on the “Older articles”-button. Could you please tell me where I can change this button to a simple numbered Navigation, like we all know it from Google or even this forum? Big thanks in advance!
My own solution
I added the buttons to my template, just beside the Title.
I don’t know if you saw my question, because it’s a bit hidden in my last post.
Could you please give me a hint, where and how I can change the displaying of the articles on the category page (which bases on the archive.php).
I would want to change the number of displayed posts and change the navigation of the different sites of posts.
By default, the sparkling theme displays the 10 newest articles, the older ones can be seen by a click on the “Older articles”-button.
For my site, I would want to show only 5 articles and have a “googlelike” Navigation.
-> http://getbootstrap.com/components/#pagination