I have an if statement that is checking the ID of the page, using the following:
<?php if ( is_page(10) ) { ?>
How can I do something like if page parent is 10?
I have an if statement that is checking the ID of the page, using the following:
<?php if ( is_page(10) ) { ?>
How can I do something like if page parent is 10?
You must be logged in to post a comment.
try something like this
Now
$id
has parent page idGet the current page object, then get its parent ID: