plugins – Hidden permalink different from displayed permalink (WordPress)

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, blue, orange
  • Items: apples, oranges, lemons, blueberries

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/

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 category on the page builder (apples does not have a colour selected when selecting sub-categories) and navigate:
    • food.com/fruits/red/ -> select apples -> food.com/fruits/colour/apples/
    • in this case the blurb 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 category, it displays an item at random. It could be the first item, it could be the third item, however it will be consistent to the point where it picks one item and displays that one 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).