[Resolved] header/layout control for client

Home Forums Support header/layout control for client

  • This topic has 3 replies, 2 voices, and was last updated 1 month ago by David.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1421225
    Jean

    My client wants most of their site to use a transparent header, but many posts they’ll be creating will need a “regular” / non-transparent header. I’m trying to avoid having to instruct them to go into GP Elements to manually exclude posts in my “Transparent Header” element. The best way I can think of is to create a special category (“Standard Header”, for example) and exclude that category — they they’d just have to tick that box when creating a post where they don’t want a transparent header. But then I still have to deal with hiding that category from meta info, search queries, etc. Is there a better way I’m not thinking of? Thanks!

    #1421567
    David
    Staff
    Customer Support

    Hi there,

    good timing, just working on something to help with this specific need 🙂

    Add this PHP Snippet to your site:

    // Generate custom taxonomy for Element Display Rules
    function element_control_custom_tax() {
        register_taxonomy(
            'element-controls',
            array( 'post', 'page' ),
            array(
                'label' => __( 'Element Controls' ),
                'rewrite' => array( 'slug' => 'element-controls' ),
                'hierarchical' => true,
                'show_in_rest' => true,
            )
        );
    }
    
    add_action( 'init', 'element_control_custom_tax' );

    https://docs.generatepress.com/article/adding-php/

    This will add a new Element Controls taxonomy to Posts and Pages.
    Simply add a new term ( like you would if it were categories ). e.g Remove Transparent Hero

    You will then find a Post Element Control > Remove Transparent Hero in Elements Display Rule Locations. You can simple Exclude that from your display rules.

    #1423545
    Jean

    !@#$ing awesome — thanks so much!!

    #1424261
    David
    Staff
    Customer Support

    🙂 Glad to be of help

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.