WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Remove "Page Title" from appearing on the page (7 posts)

  1. Mikepiff
    Member
    Posted 2 years ago #

    Hi there,
    I'm fairly new to WP, so I'm sorry if I sound wet behind the ears.
    I've got some pages on my site that I don't want the "page name" to appear on. For example, http://bananischool.org/wordpress/contact/
    I don't want "Contact Banani" to appear there before the little HTML box thingy..
    Can anyone help me with the CSS code or PHP code I need to use on this page?
    I'm using the Academica theme from Proudthemes, if that makes any difference.

    Thanks for any and all help,
    From Zambia,
    -Mike

  2. brasofilo
    Member
    Posted 2 years ago #

    This is a premium theme and you can ask for support there...

    Anyway, inside the theme file page.php, search for <?php the_title(); ?> and do something like:
    <?php if( !is_page( array( 42,'about-me','Contact' ) ) ) the_title(); ?>

    Note that the array can contain any number of pages, and you can use the page's ID (42) or slug (about-me) or title (Contact).

    Other than that, you should really ask for their support, as the theme code may be complex or hard to guess.

  3. Mikepiff
    Member
    Posted 2 years ago #

    Thanks man!
    Appreciate your quick response..
    Let me play with this, and try and contact the proudtheme folk..
    I can't get it to work.

    more soon, hopefully..

  4. KakauFiji
    Member
    Posted 2 years ago #

    I'm using Museum Core as my theme...

    I've checked the .php files and haven't been able to find the 'the_title' to delete or comment out as suggested in a number of posts.

    Ant ideas? Or am I just missing something?!

  5. Mikepiff
    Member
    Posted 1 year ago #

    Hi there,
    As I mark this topic as closed, I'd just like to mention how I "solved" the issue. I built a custom_field called "hide_title" and applied it to the pages where I wanted the header hidden.

    We made it so we can add a custom field that you can set to "1", and functions.php will then add a body-class like body.hide_title, so that we can add some generit CSS to hide it, instead of cluttering style.css w/ body.page-contact, body.home, etc..

    Code:

    // Add hide_title custom field support
    function banani_body_class ($input) {
    if (get_post_custom_values('hide_title')) {
    array_push($input, "hide_title");
    }
    return $input;
    }
    add_filter('thematic_body_class', 'banani_body_class');
    
    CSS:
    body.hide_title h1 {
    display: none;
    }
    
    body.hide_title .entry-content {
    padding-top: 0;
    }
  6. aaandre
    Member
    Posted 1 year ago #

    @mikepiff, thank you, this is a clean and flexible solution!

    To make it work with twentytwelve, use:

    add_filter('body_class', 'banani_body_class');

    instead of

    add_filter('thematic_body_class', 'banani_body_class');

  7. beepbeepv2
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic