Site logo

Archived topic

Globally Remove Page Titles

7 replies · Started by Bruce on September 9, 2016

Viewing posts 1–8 of 8

Hello Tom,

I know that there is a metabox that allows us to disable elements (such as page titles) selectively, page by page.

If we are using a page builder, there is a good chance that we would want the page titles disabled globally, and then add them back individually if we need to.

Would it make sense to add a setting somewhere to globally disable elements (check them by default)? Then if they wanted to remove the disable of an element for a page, they could just uncheck it in the metabox for that page?

Hope this makes sense. :)

Hi Bruce,

Thought I would jump in here with a suggestion as I too had been looking into a way to do so as I always use a page builder, either Beaver Builder or lately, Elementor. And as you mention, I always have to remember to check the Disable Content Title.

Now there may be a more elegant (read: proper) way to do so, but this is what I have been doing:

- install Tom's fantastic Simple CSS plugin; as well as a standalone CSS editor and inclusion in the Customizer, it places a CSS meta box in each page and post editor page.
- globally turn off the page titles with .entry-title {display: none;}
- then on those pages where you do want it, use the CSS meta box with .entry-title {display: inline;}

Cheers!
Lyle

You can disable them globally, but then it's a little bit harder to enable them only on certain pages.

Check out the filter here: https://generatepress.com/forums/topic/disable-content-title/

There's no real way to make the Disable Elements option checked by default, so I'm not sure how I would work something like this in.

The best way to do it right now is in the filter I linked to, using a conditional like:

add_filter( 'generate_show_title', 'tu_alter_title' );
function tu_alter_title() { 
    if ( is_page( array(5, 7, 8, 20) ) ) {
        return true;
    } else 
        return false;
    }
}

Where 5, 7, 8 and 20 are the page IDs where you want the title to show up.

Thanks for the suggestion Lyle. I was trying to avoid the CSS route though.

Thanks for pointing out the filter Tom. It's not ideal though, because as you said it's hard to enable on certain pages.

I was just trying to look for a more page builder friendly (Beaver Builder in my case) solution out of the gate.

Thank you both for the input though!

You can ask the BB developers if there's a way to check if BB is activated on the page using PHP.

Something like:

add_filter( 'generate_show_title', 'tu_alter_title' );
function tu_alter_title() { 
    if ( get_post_meta( 'beaver_builder_active' ) ) {
        return false;
    } else 
        return true;
    }
}

maybe tom's function above could be modified to use the 'disable content title' checkbox in the OPPOSITE way, that is, if it's checked, display the title ?

that way, it could be off by default, or on if checked. :)

Unfortunately that will require a custom solution :)

This archived topic is closed to new replies.