Post page displaying sub page without URL change

I am working on a website on WordPress for a company and I am running into the following issue. This is the structure:



Categories (sub-sections):

red, yellow, blue, orange

Items (sub-sub-sections):

apples, oranges, lemons, blueberries

Fruits is based on the Posts section of the site (it has the little pushpin beside it). The category plays into the URL for that page, so when an item is selected it would look something like:

The category page has it's own page with some visual navigation and a blurb about that category. When the fruits are selected and you navigate to one of those categories however, the page shows the content of the fruit instead of the category page that was built itself.

For ex, the URL looks like:

but it is showing the page

without changing the URL.

The only way I have remedied this so far is by NOT selecting a category, however then I run into the issue where the URL for that fruit page looks like this:

I haven't been able to find any information on this subject so far, and any help would be greatly appreciated.

In the following image you can see that the next step displays the wrong page, however the permalink at the second page is the same in both cases.

visual of this problem





@php $iterator = 0 @endphp

  @while(have_posts()) @php the_post() @endphp
    @if ($flexible_content)
      @foreach ($flexible_content as $block)
        @if ($block->block_type == 'markets_slider')
        @elseif ($block->block_type == 'static_content')
        @elseif ($block->block_type == 'expandable_content')
        @elseif ($block->block_type == 'image_+_text_listings')
        @elseif ($block->block_type == 'farmers_markets_list')
        @elseif ($block->block_type == 'fruits_list')
        @elseif ($block->block_type == 'tabbed_content')


layouts: app.blade.php

<!doctype html>
<html {!! get_language_attributes() !!}>
  <body @php body_class() @endphp>
    @php do_action('get_header') @endphp
    <div class="wrap container" role="document">
      <div class="content">
        <main class="main">
        @if (App\display_sidebar())
          <aside class="sidebar">
    @php do_action('get_footer') @endphp
    @php wp_footer() @endphp

Read more here:

Content Attribution

This content was originally published by Briana at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: