I have been using conditionals to be able to tell if I’m on a page or a subpage of that page, but I cannot for the life of me get the code to do one thing if I’m on the master page,and another thing if I’m on a subpage of that master page. This is what I have been using so far:
if ( is_page('3') || $post->post_parent == '3' ){}
Does anyone know how to check for page and subpage? In ExpressionEngine, I would use the URL slugs, but I’m not sure how to do this in WordPress. Thanks in advance!
did you try this from wordpress codex
Using the URL
for the second argument you’re goign to want to put $_SERVER[‘REQUEST_URI’] or whatever variable you can get the request from