Support » Fixing WordPress » Organizing a post list in irregular order

  • I am building a site for a church, and would like to list all posts in a specific category by Bible book. In other words, I want posts to be organized by Genesis, Exodus, Leviticus, etc.
    Each post has the name of the Bible book in its title, as well as a tag for each Bible book (like “Acts” or “Revelation”).
    Is this possible or only a pipe dream? It almost seems too good to be true.

    My current code is simply organized in alphabetical order.

    <?php
    query_posts(‘cat=4&showposts=-1&orderby=title&order=ASC’);
    if ( have_posts() ) while ( have_posts() ) : the_post();
    echo ‘<li class=”notes-post”><a href=”‘;
    the_permalink();
    echo ‘”>’;
    the_title();
    echo ”;
    endwhile;
    wp_reset_query(); ?>

    Thank you in advance!

Viewing 1 replies (of 1 total)
  • My suggestion is to create at least 2 custom field for each post

    1. The meta key would be “bible_book” and would be ex. Genesis.
    2. The second key would be “bible_book_num” and would be the numeric value associated with each book. So “1” for Genesis, “2” for Exodus.

    Then you could orderby the bible_book_num.

    Hope that helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Organizing a post list in irregular order’ is closed to new replies.