You could use an accordion:
http://tutorialblog.org/10-javascript-accordion-scripts/
As long as you’re okay with the orderby capability of the WordPress loop, you could put an accordion container straight inside the loop and collapse the content by default. That would keep everything on a single page without people having to click away to a post page.
That does seem like a good option. But what exactly do you mean by oderby capability of the loop? Because I think that is my next issue.
I have some custom taxonomies and I would like the list to be rearrangeable on either kind of taxonomy (alphabetically).
If I get that to work, that should work fine with an accordion probably?
Thanks already!
x
When you run a post query, WordPress has has some built-in ordering capabilities that you can use (search for “Orderby”):
http://codex.wordpress.org/Template_Tags/query_posts
You can use something as simple as this for alphabetical titles:
query_posts(‘orderby=title&order=ASC’);
Or if you have a custom taxonomy, you can use custom post fields and define pretty much anything you want. This would be an example giving every post a color value and then sorting ascending.
query_posts(‘meta_key=color&orderby=meta_value&order=ASC’);
Okay, thank you for this help.
I haven’t exactly gone deep into it yet. But now I made custom taxonomies. Each post-title has three fields for custom taxonomies.
I want these to be alphabetically rearrangeable.
Woul you rather advise custom fields for this?
It depends on how you’re adding the custom taxonomies to the post-title. For the orderby sorting to work, each custom field has to contain both a key (ex. color) and a value (ex. blue). That way you first identify which taxonomy to sort by (key) and then the sorting order (value). I’d recommend testing it out on a few posts to get it working, since adding all the custom fields can be time consuming.
Would I not better use tags for this? For now I used this kind of taxonomy based on this tutorial.
http://justintadlock.com/archives/2009/05/06/custom-taxonomies-in-wordpress-28
Although I must say I miss some coverage ont his topic.
That’s a great way to unlock the potential of taxonomies in WordPress based on tagging.
You could use:
<?php query_posts( array( 'people' => 'will-smith', 'showposts' => 10 ) ); ?>
to easily pull posts based on different taxonomies. However, once you’ve queried them, you’ll still have to order them somehow using an orderby property. The main difference would be that using this method, multiple posts could have the same tag (will-smith). So instead of ordering based on taxonomy, you’d be pulling all the “will-smith” related posts and then ordering within them alphabetically by title. I’d definitely run some tests using both methods to decide which works best for you to get the ordering right, then worry about adding the Javascript after.