• shanest

    (@shanest)


    I’m using the Arthemia theme to display a magazine-like publication at https://www.prometheus-journal.com

    I’ve added two custom fields, “Volume” and “Issue” to every post and would like to make an archive template so that URLs such as:

    https://www.prometheus-journal.com/volume/1/issue/3/

    automatically display posts with “Volume” value 1 and “Issue” value 3.

    The codex explains how to do it for one volume and one issue, but how can I make a page to automatically query as desired above?

Viewing 2 replies - 1 through 2 (of 2 total)
  • MichaelH

    (@michaelh)

    Can’t speak to the URLs, but here’s one possibility to be inside your loop:

    <?php
    //this code inside your loop
    if ('1' == get_post_meta($post->ID, 'Volume',true) && '3' == get_post_meta($post->ID, 'Issue',true)) {
    echo 'Volume is 1, Issue is 3';
    // the rest of your stuff here
    }
    ?>
    Thread Starter shanest

    (@shanest)

    Yea, I had similar code to that for displaying a specific volume/issue combination. I would prefer if there was a way to make the query such that it will automatically query for a volume/issue but that it could work for any one. This way I wouldn’t have to make a new query every time we publish a new Issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How do I display these custom fields?’ is closed to new replies.