Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    What exactly is the error? The best I can determine at the moment is that the term archive url, http://kulant.weblife.su/objects/shelters/ is possibly not finding any posts to show, and thus is instead showing the 404 page. Is that correct?

    Thread Starter tikowise

    (@tikowise)

    Link pages working right now. Problem was a slug same taxonomy and post type. But Taxonomy do not work correctly inside a post type, i can’t select category

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Ah, sounds like it was maybe a slug clash that you’ve since resolved, for part of the issues?

    Regarding the assigning of terms, if you’re expecting the checkbox visuals/version that you see when working with the “category” terms, set your custom taxonomy to be hierarchical. By default they’re not hierarchical, and behave like tags.

    Let me know if I’ve missed any other lingering questions.

    Thread Starter tikowise

    (@tikowise)

    Thank you Michael oh…I don’t know how this can be, but taxonomy it worked)))

    i can’t do “slug” same for taxonomy and post type ?

    • This reply was modified 7 years, 5 months ago by tikowise.
    • This reply was modified 7 years, 5 months ago by tikowise.
    • This reply was modified 7 years, 5 months ago by tikowise.
    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Generally having post type and taxonomy slugs matching exactly is going to cause more trouble than it’s worth, because WordPress uses the URL to parse out what it should query for. If you have 2 matching values, WordPress may, or may not get it right for what you’re intending. Depends on which rewrite rule it encounters first.

    If it finds the rewrite rule for post types of “thing”, which you have no posts for, but you’re intending for it to show the term archive for the “thing” taxonomy, which you do have posts assigned to, it’s going to present the post type archive and no results. If it found the taxonomy/term rewrite rules first, then it’d find those posts with the term, and show content.

    I hope I’m explaining well.

    As a second quick example, the same can happen if you have a post type slug and a created page slug matching up. It may or may not find the intended content. Like if you’re expecting a “contact” page, but you have a post type named “contact”, it may instead be showing the “contact” archive and not a way to actually reach out to you :D.

    Thread Starter tikowise

    (@tikowise)

    Thank you, Michael)
    And only question, which file is responsible for displaying the contents of categories? I would like to make my own file )

    I create “archive-objects.php” he is responsible for displaying the page of all posts this post types.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    For all the template questions, this will be the best resource https://developer.wordpress.org/themes/basics/template-hierarchy/

    Custom taxonomies get a “taxonomy.php” and such file structure, similar to how there’s category.php and all that.

    Thread Starter tikowise

    (@tikowise)

    Great work! Thank you so much, Michael! Have nice day or evening)

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Taxonomy don’t working correctly’ is closed to new replies.