• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How to remove page name from beginning of pages but NOT from posts

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to remove page name from beginning of pages but NOT from posts

This topic is: not resolved

Tagged: agency page titles

  • This topic has 10 replies, 4 voices, and was last updated 12 years, 3 months ago by eluviis.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • December 31, 2012 at 10:24 am #8598
    docmas
    Member

    Was given the following code to add in response to previous inquiry on removing page name/title from top of pages which worked, but also removed them from top of posts, which I don't want to happen.

     

    You can add this to style.css.  I suggest adding it to the Headlines section.

    h1.entry-title {
    display: none;
    }

     

    I did place it in headlines section, is there somewhere else to place or some other code to add?

     

    http://thepassiondoctor.com

     

    Thanks,

    Adam Sheck

    December 31, 2012 at 2:36 pm #8628
    Brian Bourn
    Member

    You can add this function to your functions.php file and it will remove the automatic page title from all pages, except the blog template & will keep it on posts.

    //***Remove Page Titles From All Pages Except Blog Page Template**/
    add_action( 'get_header', 'bourncreative_remove_page_titles' );
    function bourncreative_remove_page_titles() {
    if ( is_page() && ! is_page_template( 'page_blog.php' ) )
    remove_action( 'genesis_post_title', 'genesis_do_post_title' );
    }

    You can also try the plugin Genesis Title Toggle. http://wordpress.org/extend/plugins/genesis-title-toggle/


    Bourn Creative | bourncreative.com | Twitter

    December 31, 2012 at 6:18 pm #8650
    docmas
    Member

    I added this code and it gave me a critical syntax error, took out entire blog.  Even after I deleted it, still there, which makes no sense, had to reinstall Agency.  Did this twice with same result.  Any suggestions?

    Hate to use the Toggle plugin, which hasn't been updated in some time PLUS worried adding more plugins will slow things down.

    Thoughts?

    Adam

    December 31, 2012 at 6:34 pm #8651
    Brian Bourn
    Member

    Probably something to do with copy/pasting. We use this snippet on every Genesis site we build. Try grabbing it from here:


    Bourn Creative | bourncreative.com | Twitter

    December 31, 2012 at 10:00 pm #8670
    docmas
    Member

    thanks, i'll try again, AFTER i backup the agency theme, had to reinstall it twice and then add my other customizations.  hopefully no invisible characters in this one.

    have the plugin installed, but as i said, less is definitely more on wordpress.

    adam

    March 6, 2013 at 11:35 pm #24736
    eluviis
    Member

    docmas, it's better to edit functions.php on your desktop and upload via FTP after every update. That way if you break the site with a tiny PHP error, all it takes is fixing the error in the file on your desktop and re-uploading - and all it fine with the world after that.


    @Brian
    Bourn - I want to use that snippet, but I was originally going to apply a page ID to it to only use it on one specific page (a landing page), in my case page-ID 176.

    Any tips on editing that code to make it target id-176 only?

    I undertand why you apply it to all pages. It's probably an SEO thing so that you can have a short page permalink, with a long H1 tag for your title. I do that sometimes by publishing the page first and then changing the title afterwards so the permalink doesn't change. However, in this case I simply want to add a <div> wrapped H1 tag in the body of the landing page itself. In order to avoid having 2 sets of H1 tags in my page, I want to remove the title (which automatically gets an H1). You think this code snippet with a little edit would do the trick?

    March 7, 2013 at 6:58 am #24763
    frobn
    Member

    The page name and page id are in the body classes

    Try

    </pre>
    /* landing page */
    
    .landing . entry-title {display:none;}
    <pre>
    /*specific page*/
    .page-id-176 .entry-title {display:none;
    }
    
    March 7, 2013 at 12:13 pm #24810
    eluviis
    Member

    Hi, oh, I know how to find the post and page id's. The CSS is relatively simple. What  I'm unsure of is editing Brian Bourn's PHP code from "page template" to "page-id." What I need done has to be done via PHP and not CSS.  It's not simply a display issue, it's also an SEO issue. If I hide the title using CSS, I will still have the title in the code wrapped in H1 tags. I can't have that because I want to apply H1 tags to a specific line of text in the body of my page - I'd end up with two different lines of text wrapped in H1, and you should only have 1. Using PHP to remove the title from the page will do it cleanly - also removing it from the source code of the page, not simply hiding it like CSS does. See what I mean?

    March 7, 2013 at 1:58 pm #24836
    frobn
    Member

    Include the page-id # in Bourn's PHP

    if ( is_page( page# )

    March 7, 2013 at 2:04 pm #24840
    eluviis
    Member

    ^ Ok great, I'll try that. Not sure what all the divs in each line are for though. I suppose I don't need to include those, right?

    March 9, 2013 at 4:32 pm #25222
    eluviis
    Member

    Finally got around to trying this. @frobn - That worked perfectly, thanks. (Had to get a bit of help from a friend as well) Here's the edited snippet:

    //** Remove page title from About Page landing page */
    add_action( 'get_header', 'bourncreative_remove_page_titles' );
    function bourncreative_remove_page_titles() {
    if ( is_page(176))
    remove_action( 'genesis_post_title', 'genesis_do_post_title' );
    }

  • Author
    Posts
Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble