0

I am currently learning about creating and modifying themes for WP and I am stuck on this one thing. I see that there are a lot of people with similar problem but I didn't find a solution to mine.

The problem is that pages work fine and the content is displayed but the content of sub-pages (child-pages) are not found. I have created page with sub-page with content but wordpress just can't find it. Firstly I thought that its my theme problem but after switching to default themes (twenty fifteen,sixteen,seventeen) the result is the same so is it .htaccess problem? If so I have the default .htaccess and I never changed anything in it.

I also tried switching back and forth between permalink settings - same result.

Thank you.

Edit: To be clear, there is no error 404 just my if ( have_posts() ) : goes straight to else. Original themes if clause goes to else too.

Edit2: Thank you @BlueSuiter. Changing the slug of the parent fixed the problem. Switching it back made the problem again. Does anyone know why this happens and how to avoid it?

  • Is there any taxonomy in your website, with same slug as of parent page? – BlueSuiter Feb 10 '18 at 17:49
  • Nope the hierarchy is Categories -> Computer monitors – Morsus Feb 10 '18 at 18:00
  • 1
    Change the slug of parent page, reset permalinks and then try to run it again. – BlueSuiter Feb 10 '18 at 18:38
  • 1
    Just so I can mark it solved. > Thank you @BlueSuiter. Changing the slug of the parent fixed the problem. Switching it back made the problem again. Does anyone know why this happens and how to avoid it? – Morsus Feb 11 '18 at 17:42
  • This was happened because of slug conflict. There must be same slug assigned to some of the taxonomy. There is no internal check for this in WordPress. – BlueSuiter Feb 12 '18 at 6:02

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.