Removing Page Titles | Pretty Pictures Theme

Community Forums Forums Design Tips and Tricks Removing Page Titles | Pretty Pictures Theme

This topic is: not resolved

This topic contains 29 replies, has 7 voices, and was last updated by  braddalton 1 year, 3 months ago.

Viewing 15 posts - 16 through 30 (of 30 total)
  • Author
    Posts
  • #16964

    khawaja1971
    Participant
    Post count: 3

    I would also like this to be resolved.  If I use the Genesis Title Toggle plugin I can remove the title from my home “page”.  But if I put the following code at the end of home.php in Balance theme it has no effect.

    remove_action( ‘genesis_post_title’, ‘genesis_do_post_title’ );

    From everything I read it really should work.  I`ve also tried the whole functions.php thing as well to no avail.  There is a whole bunch of white space I would really like to remove to make the home page a bit more voter / mobile friendly.

    #19824

    braddalton
    Participant
    Post count: 9415

    Is this resolved now?

    Here’s a good tutorial on removing titles using conditional tags

    http://wpsmith.net/2011/genesis/remove-post-title-and-page-title-from-genesis-child-theme-with-or-without-post-formats-support/


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #19845

    khawaja1971
    Participant
    Post count: 3

    More ignored rather than resolved.  I’ve put the code in various different places including functions.php and home.php without effect.

    #19968

    KBordonaro
    Participant
    Post count: 22

    Hi, Brad.

    I used the code for removing page titles… but now it’s removed the blog post titles on the blog page.

    So frustrating!

    Any ideas on what to do?

    Kimberly

     

    http://www.kimberlybordonaro.com

    #20268

    braddalton
    Participant
    Post count: 9415

    Remove this code from your child themes functions file if you are NOT using or planning on using post formats.

    Backup the file first.
    [php]
    /** Add support for post formats */
    add_theme_support( ‘post-formats’, array(
    ‘gallery’,
    ‘quote’
    ) );

    /** Remove elements for post formats */
    add_action( ‘genesis_before_post’, ‘pp_remove_elements’ );
    function pp_remove_elements() {

    // Remove if post has quote format
    if ( has_post_format( ‘quote’ ) ) {
    remove_action( ‘genesis_before_post_content’, ‘genesis_post_info’ );
    remove_action( ‘genesis_post_title’, ‘genesis_do_post_title’ );
    remove_action( ‘genesis_after_post_content’, ‘genesis_post_meta’ );
    }

    // Remove if post has gallery format
    elseif ( has_post_format( ‘gallery’ ) ) {
    add_action( ‘genesis_post_title’, ‘genesis_do_post_title’ );
    add_action( ‘genesis_after_post_content’, ‘genesis_post_meta’ );
    }

    // Add back, as post has no format
    else {
    add_action( ‘genesis_before_post_content’, ‘genesis_post_info’ );
    add_action( ‘genesis_post_title’, ‘genesis_do_post_title’ );
    add_action( ‘genesis_after_post_content’, ‘genesis_post_meta’ );
    }

    }
    [/php]

    Then add this code to the end of your child themes functions.php file.

    This will remove the page titles from all single pages. You can change the conditional tag to remove titles from other pages, posts etc.
    [php]
    //remove page titles only sitewide
    add_action(‘get_header’, ‘child_remove_page_titles’);
    function child_remove_page_titles() {
    if ( is_page() ) {
    remove_action(‘genesis_post_title’, ‘genesis_do_post_title’);
    }
    }
    [/php]


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #20269

    braddalton
    Participant
    Post count: 9415

    Note: A Post formats UI maybe included in the next version of WordPress 3.6 and added to the editor.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #20272

    braddalton
    Participant
    Post count: 9415

    Please let me know if this is what you wanted.

    [php]
    add_action(‘get_header’, ‘child_remove_page_titles’);
    function child_remove_page_titles() {
    if ( !is_page() || is_single() ) {
    remove_action(‘genesis_post_title’, ‘genesis_do_post_title’);
    }
    }
    [/php]

    This code removes titles from all single posts but not single pages or archive pages like your blog page.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #21502

    KBordonaro
    Participant
    Post count: 22

    Thanks, Brad!

    I don’t think I was clear…

    I’m trying to remove the titles from the single pages, not single posts.

    I still can’t get it to work. :(

    -Kimberly

    #21569

    braddalton
    Participant
    Post count: 9415

    Use the conditional tag for single pages and it will work as long as you remove the post formats code.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #21811

    KBordonaro
    Participant
    Post count: 22

    I’m such a coding rookie…

    So I copy and paste the code you put (above my last reply), but I change the conditional tag to look like this:

    add_action('get_header', 'child_remove_page_titles');
    function child_remove_page_titles() {
    if ( !is_page()  || is_single() ) {
    remove_action('genesis_page_title', 'genesis_do_page_title');
    }
    }

    #22277

    braddalton
    Participant
    Post count: 9415

    Not sure of the conditional statements to use. The guys on the WordPress Codex aren’t either. Been a hard a few weeks mentally with all the coding. Hopefully i can work it out for you soon.

    The function works so its just a matter of working out which tags to use in the function.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #22279

    braddalton
    Participant
    Post count: 9415

    I think i have worked it out using CSS.
    [css]
    .page-template-default .entry-title {
    display:none;
    }
    [/css]


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #41247

    SociallyExceptional
    Participant
    Post count: 55

    The Toggle pluggin works great if you check on each page that you don’t want the title to show. Then the blog titles will still show. If you click the box inside the Genesis theme options to remove every header by default then it takes out the blog titles too

    #41968

    karino
    Participant
    Post count: 1

    Hi Brad

    I typed in your suggestion -into the functions.php at the end as suggested.

    /**remove page titles only sitewide*/
    add_action(‘get_header’, ‘child_remove_page_titles’);
    function child_remove_page_titles() {
    if ( is_page() ) {
    remove_action(‘genesis_post_title’, ‘genesis_do_post_title’);
    }

    It works a treat! thanks – this was really bugging me.

    #41980

    braddalton
    Participant
    Post count: 9415

    No worries Karino.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

Viewing 15 posts - 16 through 30 (of 30 total)

You must be logged in to reply to this topic.