2016-03-04, 16:04:43
Hmm... There are numerous ways to do it.
You can identify the target page by slug for example:
Or, simply check if the current page has a specific parent then show your component:
Or generally, when the same rules apply to all child pages on entire template, you can see whether page has parent then show your component:
You can identify the target page by slug for example:
Code:
if(get_page_slug(false) == 'ma_slug') {
// show component ...
}
Or, simply check if the current page has a specific parent then show your component:
Code:
$parent = get_parent(false);
if(!empty($parent) && $parent == 'page_parents_slug') {
// show component ...
}
Or generally, when the same rules apply to all child pages on entire template, you can see whether page has parent then show your component:
Code:
if(!empty(get_parent(false))) {
// show component ...
}