WordPress.org

Ready to get started?Download WordPress

Forums

custom post types and tag pages... (2 posts)

  1. somethingelse
    Member
    Posted 1 year ago #

    ok. i have searched... for 2 days now... and can't quite get this.
    maybe i'm just not searching the right terminology, not sure but here's the issue:

    i have custom post type "venueprofile" created using pluging "WCK Post Type Creator" (realizing now that i should have just done it myself with functions etc, but that's another story).

    so, after much fiddling and forum searching and codex diving, i have managed to create custom templates for said post type that does what i want - so post type displays exactly how i want, with the tag list for each category within the custom post types displayed at the top...

    got as far as being able to click thru to the custom post type tags...
    and have come to a roadblock.

    i cannot seem to make the tag pages display posts alphabetically without making all the other category & tag pages also display alphabetically, which i do not want... i ONLY want posts that are type venueprofile to display alphabetically

    i've tried 'global $query_string; query_posts($query_string . '&orderby=title&order=ASC');' and that works great as far as alphabetizing, but it does it for everything.

    the theme is a child of Max-Magazine, and is constructed with a lot of nested page templates...

    so to get to a tag page, i have a custom tag template - tag-victoria.php (i'm just working on one for now... )

    which, based on the original tag.php page calls to
    get_template_part('includes/content');

    for the life of me i cannot figure out how to use a custom content.php for the TAG pages... i have one just fine for the category pages (content-venueprofile.php - works like a charm) but if i try to use THAT one included in the tag-victoria.php it doesn't work.

    are you following?? i'm barely following so...

    here's the site - http://www.bcmusicianmag.com
    section in question is http://www.bcmusicianmag.com/venueprofile

    if you follow along and choose a region, then a city tag, you'll get to where i'm after... current, the only one with the aforementioned configuration is http://bcmusicianmag.com/tag/victoria

    for comparison's sake, here's a non-venueprofile tag page
    http://bcmusicianmag.com/tag/barbara-bruederlin

    all i want is the venueprofile tag pages to display the posts alphabetically... and leave all other stuff alone.

    will be sooooo grateful to the wizard who can solve this for me...

  2. bcworkz
    Member
    Posted 1 year ago #

    Using query_posts() is a reasonable approach. To stop using orderby title for other queries, just execute wp_reset_query() when the tag loop is finished.

    I'm not sure how to get tag templates loaded. It may be a matter of naming it correctly. get_template_part() tries to find it, and when it can't it goes down a list of possibilities until it finds something. If you do a little sleuthing in that function with a temporary insertion of vardump($template);die();. You might see what tag template it tries to load first. That may be how your file should be named. $template used here is a place holder. Examine the source and place a variable who's value you want to check in it's place.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.