0

I am working on a website which I did not create on WordPress for a company and I am running into the following issue.

Structure

  • Category: fruits
  • Sub-categories: red, yellow, orange
  • Items: apples, oranges, lemons

When apples are selected the permalink would be: food.com/fruits/red/apples/. In this example, there are pages dedicated to each of the following:

  • food.com/fruits/
  • food.com/fruits/red/
  • food.com/fruits/red/apples/

Problem

When you navigate to one of the sub-categories (such as red), the page shows the content of the items (apples) instead of the sub-category page itself.

Ex: fruits -> red is selected.

  • Page showing: food.com/fruits/red/apples/ (1)
  • Permalink showing: food.com/fruits/red/ (2)
  • If I don't select a sub-category on the page builder (apples does not have a colour selected) and navigate:
    • food.com/fruits/red/ -> apples -> food.com/fruits/colour/apples/
    • in this case the red page displays, but the permalink is missing the colour category even though you would navigate through red to get to apples.

If there are multiple items in the sub-category, it displays an item at random. It could be the first item, it could be the third item, however it will be consistent where it displays the same item every time.

I have searched through every plugin .php file and so far have not been able to find anything useful. What I was able to do however, was print out the hidden permalink, which looks like (1), even though the browser link displays (2).

Question

How do I select a sub-category for each item and still display the sub-category page? Each sub-category page is built and set up, but right now I can't view any of them on the site without removing the sub-category selections from each item.

enter image description here

11
  • but does the red category not contain the apples category? Parent child relationships with terms are nested, think of them not as connected boxes, but nested boxes. The fruit category doesn't just contain everything you checked the fruit box, it contains everything where you checked the sub-terms/children too. I'm assuming that fruit/red/apple are all terms in a single taxonomy, with their primary difference being how deep down the hierarchy they are?
    – Tom J Nowell
    Jul 19 at 16:19
  • Red does contain apples, but when I'm editing the site and I say that apples is in the "red box", then when I navigate to red on the website it shows the apples page instead of the red page. Also yes, the fruits/red/apple section is made up of hierarchical sections where users can navigate to fruits, then to red, then to apples, with a different page at each step.
    – Briana
    Jul 19 at 17:25
  • red contains apples, so all things in the apples term will also appear in red. It sounds like you want only items marked as red, but not reds children to be displayed, which is not standard behaviour, is that correct?
    – Tom J Nowell
    Jul 19 at 17:31
  • Sorry, I think we're getting some wired crossed. Red contains apples, however red has its own page with information on red itself. It has a section with links to navigate to see the apples information, with a 200 character preview/description of what is contained in apples. The apples page is independent of the red page. Keep in mind that red may also contain cherries, strawberries, and raspberries, which will each have a button with a small description right alongside apples.
    – Briana
    Jul 19 at 17:38
  • Think of it like a textbook. Fruits is a section of the book which contains all colour categories and all fruits within them. The colour categories have brief descriptions of all of the fruits with a page number to jump to that specific fruit. The fruit itself contains in depth information about that specific fruit. I hope this helps :)
    – Briana
    Jul 19 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.