Site logo

Archived topic

[FEATURE REQUEST] Elements to target child pages

4 replies · Started by Fabien on January 15, 2021

Viewing posts 1–5 of 5

Hi,

It would be great to be able (without a function) to target child pages (ancestors) using elements.

Beaver Builder / Themer has this feature : https://share.getcloudapp.com/7Kub5KGo

Thanks !

Fabien

Hi there,

we agree ... it is something we are looking into :)

Awesome !

One more question, as the feature is not here yet.

I am using the following function to display a right sidebar on my child pages :

add_filter( 'generate_block_element_display', function( $display, $element_id ) {
	
	global $post;

    if ( 1560 === $element_id && (( is_page() && 932 == $post->post_parent )|| is_page(932) ) ) {
        $display = true;
    }

    return $display;
}, 10, 2 );

It works well, however the CSS related to the block is not always generated...

Sorry what is the CSS you are referring to here?

Something you've added?

This archived topic is closed to new replies.