• Hey,

    I am trying to remove the title of the menu from my actual page. For example, when you enter my landing page (Home) on the page itself it says Home, and I would like that removed (www.bestselfexperience.com). i do not know where in my CSS I can find this to change it.

    Best wishes,

    Mette

Viewing 13 replies - 1 through 13 (of 13 total)
  • Well, it’s usually a good idea to have a title in addition to the menu label, if only for SEO purposes. You can of course have a page title that is different from the menu label by changing your page title to whatever you want it to be and then editing your menu (Dashboard –> Appearance –> Menus) so that the menu label for the page is different from the page title.

    However, if you’re determined to get rid of page titles altogether, you need to remove the elements that contain this function call:

    <?php the_title(); ?>

    … from your theme’s (brunelleschi) ‘loop.php’ file. They are usually <h1> or <h2> elements sometimes with nested anchors (<a>). Commenting them out is usually the safest bet.

    You don’t actually say what theme you’re using, but it appears to be brunelleschi. If it’s a different one, you may have to do things a bit differently.

    You can, of course, select which page types you do this for—which in the case of the brunelleschi theme means 404 (not relevant), gallery, aside, everything else—by checking the part of the if() statement in which the call takes place and only getting rid of those you don’t want.

    An alternative way of doing the same thing would be to discover the elements that you don’t want to appear and using specific CSS selectors set the display property on those elements to none. This might be preferable if getting rid of the function call gets rid of the title in places where you want to retain it. Using CSS only, might give you some finer-grained control over which titles to remove.

    Finally, of course, in order to follow the WP developers’ recommendations, you should make all changes to themes using a Child Theme. Many people think this is unnecessary for non-default themes, but it is the only recommended way of making changes.

    HTH

    PAE

    Thread Starter MetteM

    (@mettem)

    Hey,

    thank you so much for your reply!! I really only want to move the Home page title.. the others are fine. I have found the <?php the_title(); ?> in the loop.php. So how do I write in this php that I only want to remove the page title for Home? I don’t really understand the if( ) part (sorry, am not that good, yet, at coding)… oh, and yes, I am using Brunneleschi.

    Thank you so much for your help!

    Best wishes,

    Mette

    Since you want to be selective like this (i.e. you just want to do it for your home page), You’d probably be better off doing this in CSS rather than messing with the Template file. That is, we should use the alternative method I mentioned.

    Before going on, and for completeness, I perhaps should also say that you have other choices, like creating a ‘front-page.php’ file that will provide a template just for your front page, since you have a static front page. However, I’ll not pursue this unless you have some reason for preferring it as a solution (or perhaps if the solution below doesn’t work!).

    A CSS solution would be to add a style rule like the following to your styles:

    body.home h2.entry-title {
      display: none;
    }

    Once again, I would recommend you do this in a child theme, especially if you are not that good at coding. It will keep all your changes in one place and will mean you can fall back to the parent theme if your changes behave in an unexpected way. Not to mention its more obvious advantages.

    If you do use a child theme, simply add the new style rule to the end of the child theme’s style.css file (i.e. immediately after the @import url('../brunelleschi/style.css'); statement if you haven’t added any other styles to your child.

    If you’re risking altering the brunelleschi theme itself, then I suggest you add the rule to the end of that theme’s style sheet, preferably in a comment block that states that these are your changes. And I’d recommend that you keep a backup copy of the style sheet, renewing it after every change you make.

    HTH

    PAE

    Thread Starter MetteM

    (@mettem)

    Yay!! It worked!! I have the style tweaker plugin so I added the code you suggested, and it worked wonders! Thanks SO much for your help!

    Best wishes,

    Mette

    De nada

    PAE

    Hi peredur, I see you managed to sort out MetteM’s problem. I have the exact same issue and am using the Simpler CSS plugin, but adding the code you suggested (exactly as you put it above) it doesn’t take the title off of my home page (www.timclare.com) using the Motion 1.1.6 theme.

    Any suggestions?

    The code necessary for every theme is different. Post a link to your site and I’ll have a look.

    Cheers

    PAE

    Hi peredur, thanks for your quick reply. As mentioned above my site is http://www.timclare.com Thanks for any help you can give

    One of the problems you have is that the XHTML for your site is invalid:

    http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.timclare.com%2F

    This means that it’s harder to get a handle to the title. The title text is directly inside a <div>, rather than being in an <hn> element (where ‘n’ is a digit 1-6). It will also make getting your site to render correctly in all browsers that much more difficult. The theme’s home page claims that the XHTML is valid. That being the case, then either you have made some changes to invalidate it, or a plugin has.

    Just out of interest, I installed the theme on a test site. It validated except for some stray ampersands and a closing <a> tag for an anchor that was not opened. This latter is bad, but given its location in the file it probably isn’t going to do too much harm. So it’s OK straight out of the box. But it does put page titles directly into a div; which is not good. The trouble is, I can’t identify why the title is not in an <h2>. The template files’ code certainly seems to want to put it in one. So we’ll have to make do with what we have.

    So with all that said, a rule like this might work:

    div#content div#post-30 {
      display: none;
    }

    If your home page ever became anything other than post number 30, though, it would stop working.

    I can’t say anything about the plugin that you have for CSS, by the way. The CSS I’ve given you should be OK if you edit the styles directly (in a Child Theme, if you’re wise, IMHO), but I’ve no idea if it’ll work with your plugin.

    HTH

    PAE

    Hey, thanks for taking a look.

    I don’t plan on changing the home page at all so no problem with it staying as post 30. I wasn’t sure how to fix the errors in the xhtml so I guess i’ll leave that. I hope that it doensn’t cause too much of a problem on other browsers.

    I tried to add in the rule that you listed but it appears to hide the whole page from displaying. I tried directly in the style sheet and with the css plugin.

    Oh yeah! It would. It’s because it’s hiding the whole content of the div.

    Hmm. Not sure how to do it, therefore. You really need that title in an <h2>.

    The only thing I can suggest is that you content the theme developers.

    Sorry I can’t be of more help.

    Cheers

    PAE

    No it’s fine. Thanks for trying anyway! 🙂

    Hi,
    I have deleted the <?php the_title(); ?> in the ‘loop.php’ file but the titles are still there… Any suggestions much appreciated.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Removing menu title from page’ is closed to new replies.