Forums

how to hide page titles? (frugal theme) (4 posts)

  1. jennifer9nm
    Member
    Posted 1 year ago #

    My blog is at No One's the Bitch.

    I'd like to remove page titles from all the pages and have tried a variety of fixes, but nothing's working.

    If I remove the following from my page.php file, I still see the titles:

    <h1><?php the_title(); ?></h1>

    I followed the instructions from here, even though the code was slightly different from what I see in page.php.

    I replaced the code above with:

    <?php if ( is_front_page() ) { ?>
    	<h2 class="entry-title" style="display: none; height= 0px;"><?php the_title(); ?></h2>
    <?php } else { ?>
    	<h1 class="entry-title" style="display: none; height= 0px;"><?php the_title(); ?></h1>
    <?php } ?>

    ... and nada!

    Do I maybe need to edit other .php files?

    Please help! We have a big affiliate launch coming up tomorrow and this is driving me crazy.

    I recently added the Exclude Pages plugin to hide some new pages from the navigation menu. Works great, but wanting to hide page titles seems like such a common problem, I'm surprised it's this hard to do!

    Big thanks,
    Jennifer

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Removing page titles is really bad for usability and SEO. If you must hide them, do so using CSS.

  3. jennifer9nm
    Member
    Posted 1 year ago #

    Thanks, Esmi!

    Yes, that's also what another person said, who provided the code that I tried to use above.

    I'm wondering if the reason NOTHING seems to be working is because I need to make changes on another php file as well. I barely understand any of this stuff. :-)

    Any other suggestions? Since the code on my page.php file wasn't exactly the same as the fix I posted above, maybe there's something I missed or got wrong?

  4. jennifer9nm
    Member
    Posted 1 year ago #

    This is what's in my page.php file:

    [Code moderated as per the Forum Rules. Please use the pastebin]

Topic Closed

This topic has been closed to new replies.

About this Topic