WordPress.org

Ready to get started?Download WordPress

Forums

Using custom taxonomy "under the hood" only - Insight plz? (2 posts)

  1. weex
    Member
    Posted 3 years ago #

    Ok. I am developing my own theme for a website more or less from scratch in terms of css/html design and also PHP.

    I need to organize and present posts in different ways beyond just a "blog" that lists things in order by date.

    So I've practiced and familiarized myself wp_get_meta and using meta data, which is useful at times.

    But I find that using a custom labels/tags taxonomy seems really good over meta data for doing other stuff like using the WP_Query object to query posts for building lists and other loops:

    Example #1: I want to construct a list of posts that meet a certain condition (only need to display title and date during the loop). I want to have this list exist dynamically inside of an individual post. So I could just use a custom taxonomies label like "label-123" and create a WP_Query object that pulls all posts with that label. I'd just have to toss the required conditions into $args. Build that process into a short code function with a custom loop and done.

    Example #2: If a post as a certain labels/tags of my custom taxonomy certain functions would execute in my sidebar to display different information. In other words I'm using them for quick "if { ... }" triggers in my UI design of my theme.

    I don't want this taxonomy to exist in any purpose to the web visitor or crawler bot. Internal, under hood php coding use only. Absolutely non-existent.

    So I pose 2 questions:

    1 - Is it feasible to use a custom taxonomy in such a fashion - disable any working URLs associated with this taxonomy so it completely does not exist to the visitor or search engine bot etc. How would I do this? Does this make sense to a seasoned WP developer?

    2 - Is this considered bad practice? If so is there a better way?

  2. weex
    Member
    Posted 3 years ago #

    Additionally,

    - I have no website or URL to provide you with: I'm developing offline with MAMP.

    - I know that I could do things more efficiently like a plugin that caches a list upon any updating of a post versus repetitive loops etc but I think that's beyond my core question.

    Thanks for reading and let me know if you need anymore clarification!

Topic Closed

This topic has been closed to new replies.

About this Topic