WordPress year/issue-based magazine URL structure…how did they do this?

I’ve seen a lot of almost answers but nothing definitive, so here I am.

I’m trying to structure my WP permalinks as http://magazine.pomona.edu does. The site is organized as http://example.com/%volume_year%/%volume_issue%/%postname%/. Example: http://magazine.pomona.edu/2012/fall/a-carefully-calculated-caper/

Read More

I’m having problems figuring out a permalink structure that doesn’t give 404s or 400s. I created two custom taxonomies, ‘volume_year’ & ‘volume_issue’. I changed my permalink structure to reflect these (/%volume_year%/%volume_issue%/%postname%/) and checked the appropriate terms within the post admin (2012 & Fall).

However, when I attempt to view the post, which should be at http://example.com/2012/fall/lost-and-found/. I get a 400 Bad Request error and my URL is http://example.com/%volume_year%/%volume_issue%/lost-and-found/. Obviously, the placeholders are not being converted to terms. What am I missing, and/or does anyone have a better way to do it?

Here’s my code, fwiw:

$labels[0] = array(
            'name'                       => 'Year',
            'singular_name'              => 'Year',
            'menu_name'                  => 'Year',
            'all_items'                  => 'All Years',
            'parent_item'                => 'Parent Year',
            'parent_item_colon'          => 'Parent Year:',
            'new_item_name'              => 'New Year Name',
            'add_new_item'               => 'Add New Year',
            'edit_item'                  => 'Edit Year',
            'update_item'                => 'Update Year',
            'separate_items_with_commas' => 'Separate years with commas',
            'search_items'               => 'Search years',
            'add_or_remove_items'        => 'Add or remove years',
            'choose_from_most_used'      => 'Choose from the most used years',
        );

        $rewrite[0] = array(
            'slug'                       => 'volume_year',
            'with_front'                 => false,
            'hierarchical'               => true,
        );

        $args[0] = array(
            'labels'                     => $labels[0],
            'hierarchical'               => true,
            'public'                     => true,
            'show_ui'                    => true,
            'show_admin_column'          => true,
            'show_in_nav_menus'          => true,
            'show_tagcloud'              => true,
            'query_var'                  => 'volume_year',
            'rewrite'                    => $rewrite[0],
        );

        register_taxonomy( 'volume_year', array('post'), $args[0] );

        $labels[1] = array(
            'name'                       => 'Issue',
            'singular_name'              => 'Issue',
            'menu_name'                  => 'Issue',
            'all_items'                  => 'All Issues',
            'parent_item'                => 'Parent Issue',
            'parent_item_colon'          => 'Parent Issue:',
            'new_item_name'              => 'New Issue Name',
            'add_new_item'               => 'Add New Issue',
            'edit_item'                  => 'Edit Issue',
            'update_item'                => 'Update Issue',
            'separate_items_with_commas' => 'Separate issues with commas',
            'search_items'               => 'Search issues',
            'add_or_remove_items'        => 'Add or remove issues',
            'choose_from_most_used'      => 'Choose from the most used issues',
        );

        $rewrite[1] = array(
            'slug'                       => 'volume_issue',
            'with_front'                 => false,
            'hierarchical'               => true,
        );

        $args[1] = array(
            'labels'                     => $labels[1],
            'hierarchical'               => true,
            'public'                     => true,
            'show_ui'                    => true,
            'show_admin_column'          => true,
            'show_in_nav_menus'          => true,
            'show_tagcloud'              => true,
            'query_var'                  => 'volume_issue',
            'rewrite'                    => $rewrite[1],
        );

        register_taxonomy( 'volume_issue', array('post'), $args[1] );

Related posts

Leave a Reply

1 comment

  1. We did a very similar thing for a local business newspaper. They published every other Friday and used the concepts of Issues and Volumes. We found the best way for them was to simply let them tag the articles into a categories with appropriate names. We then filtered and placed content into the appropriate areas of the site based on those categories.

    We kept the issue and volume information out of the URL because it isn’t relevant to how search engines categorize and index the articles.

    What WAS important to Google was the inclusion in the URL of a unique number at least 3 digits long. This allowed our information to get into Google News. We just used the post ID in the URL to ensure uniqueness and reseeded the post table to 400 so the first article’s ID would be 401.
    Read more about that at http://support.google.com/news/publisher/bin/answer.py?hl=en&answer=68323

    This property has now switched to be a monthly magazine, but since we didnt include volume and issue information in the URL we didnt have to change anything and easily retained many years of content that simply absorbed the new theme’s styling.
    On this page, you can see where we made the switch. Oct 2011 is new and Sep 2011 is old. http://columbiabusinesstimes.com/archives/page/17/
    Notice the newer issue has different tags and has an image by each article.

    Hope that helps someone as an example.