Check Page Level Depth If Condition in WordPress

  • Updated on
  • read
  • Add to Flipboard Magazine.

The code snippet below is handy when you are trying to check if the current page is a parent or a child in a WordPress theme. You can then use the conditional to output different code depending on the page depth it is

Source: Get the depth of the current page in WordPress

Want to save time using Bootstrap?

Bootstrap 4 Book
& Starter Templates

Learn by building a CMS admin dashboard and marketing homepage step by step.

Learn More

Written by: Jacob Lett
Category: Code Snippets

Leave a comment

Related Posts

Blog Home