Order of Categories listed on Post

Support Area Forums Foundation Order of Categories listed on Post

Viewing 4 posts - 1 through 4 (of 4 total)
URL to the page in question: http://targetingexcellence.org/scholarship-winner/amanda-smith/
  • Author
    Posts
  • #36857
    Dave Funderburke
    Participant

    How do I rearrange the order of the categories listed on a post? In the URL I provided the categories are all mixed up even though I used parent/child relationships when creating the categories.

    This is the order they should be listed in:

    – Bachelor Degree Award (East) 2015 Scholarship Recipient
    – Undergraduate Degree Award (North Carolina) 2016 Scholarship Recipient

    The other option is to tell me how to remove the 2015 line of information from the post but not actually remove those categories as it would break our 2015 Scholarship Winners page that lists all the winners.

    #36862
    Bill Robbins
    Moderator

    Great question there. Parent/child relationships with taxonomies (categories and tags are both taxonomies) often don’t mean anything as far as how WordPress displays information. With pages it does affect the URL structure and it may do that if you’re viewing an archive of one of the child taxonomies. Outside of that, it’s basically invisible to visitors in just about every respect.

    The order of taxonomies is set by the order in which they were created. There is a plugin called Category Order and Taxonomy Terms Order (https://wordpress.org/plugins/taxonomy-terms-order/) that you may be able to use to reorder them. It adds a drag and drop interface so you can change what order they are displayed. I’ve used it with the sermon series in our church themes to reorder those and it has worked in that situation. Hopefully it’ll do the trick here for you.

    Let me know if it gives you any trouble and have a great weekend,
    Bill

    #36925
    Dave Funderburke
    Participant

    I have installed the recommended plugin and rearranged the categories in the correct order. However, it is not changing the order they are displayed on the individual page.

    By chance do I need to change something in this section of code in the theme:

    <?php

    $terms = wp_get_post_terms( $post->ID, ‘scholarship-group’ );
    if ($terms) {
    foreach($terms as $term) {
    echo ‘<p class=”staff-meta”>’ . $term->name . ‘</p> ‘;
    }
    }

    ?>

    If not, any other ideas how to get the display to actually match the order of the categories?

    #36929
    Bill Robbins
    Moderator

    Hey David,

    I think we may have been thinking about two different things here. Are you looking to break the list up by scholarship group? If that’s the case, we’ll need to approach this differently. The page template for scholarships, just makes a unified list of the the scholarship winners.

    If you need to have separate lists on one page, then here’s what to do. Instead of using the Scholarship Winners Page template, go with one of the standard templates. Then in the main content area, you can use a shortcode to display a list of the scholarship winners in a group. Here’s what the shortcode looks like:

    
    [scholarship group="gold"]
    

    where gold is the url slug of the group. You can find the slug by going to the scholarship section of your dashboard and clicking on scholarship groups. The slugs will be listed next to each group’s name. Just replace gold with the appropriate slug and on the front end of your site, that will turn into a list.

    You can place text, videos, images and just about anything else above and below each list. Add in all your lists and that should break them out for you. Let me know if that doesn’t do the trick.

    Take care,
    Bill

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Order of Categories listed on Post’ is closed to new replies.