I have a custom function in my theme that creates a dynamic
For that I’m using
$myVar = get_posts( array(...) ). In that array I need to exclude some pages.
I want to exclude some parent page and all its children pages.
I want to use only parent page slug to get an array of all the IDs of the parent and the children.
The problem: the
'exclude' => in the
array() accepts only an array of IDs. Not slugs.
How can I achieve it with some function (or some other way) to return an array of IDs by parent page slug including parent ID and all its children?
For the example let’s say the parent page slug is