WordPress.org

Support

Support » How-To and Troubleshooting » Removing title from twenty ten theme

Removing title from twenty ten theme

  • I am trying to hide the title for the twenty ten them I used the
    #header h1 { display:none }
    in the style.css but this only works for the first page any ideas?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Moderator Michael

    @alchymyth

    Forum Moderator

    this is because only the front page uses h1 for the title;

    look into header.php (from line 60) for the way how it is done:

    <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
    				<<?php echo $heading_tag; ?> id="site-title">

    adjust your css accordingly…

    Sorry I am very new to editing code do I change the css withtin the php file or add another line to style.css

    thanks

    Moderator Michael

    @alchymyth

    Forum Moderator

    you would edit the css in style.css of the theme;

    in your case, to hide the title, you could edit the existing style:

    #site-title {
    	float: left;
    	font-size: 30px;
    	line-height: 36px;
    	margin: 0 0 18px 0;
    	width: 700px;
    }

    and add a display:none; to the end – so the result would look like:

    #site-title {
    	float: left;
    	font-size: 30px;
    	line-height: 36px;
    	margin: 0 0 18px 0;
    	width: 700px;
        display:none;
    }

    hi there,
    this tips works very well for me too…but what should I do if I want to upload an image-logo where the site title is?
    this is a site example of what I am trying to do
    http://www.touchmusic.org.uk/

    Moderator Michael

    @alchymyth

    Forum Moderator

    the following is one possible way to add a logo to Twenty Ten, in place of the blog title:

    edit header.php, find:

    <div id="branding" role="banner">

    after that line, insert:

    <div id="header-logo"><a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/wordpress.png" alt="logo" /></a></div>

    edit style.css, add:

    #site-title { display:none; }
    #site-description { display: none; }
    #header-logo img { float:left; border: none; margin: 0px; }

    change the margin values to position the logo.

    warning:
    all modifications to Twenty Ten will be overwritten with the next update of wordpress.
    consider creating a child theme: http://codex.wordpress.org/Child_Themes

    fantastic, thanks a lot!

    …sorry but where do I insert my image logo?

    Moderator Michael

    @alchymyth

    Forum Moderator

    my bad –

    your logo should go where i have /images/wordpress.png

    let us assume that your logo image is called logo.png and is located in the images folder of the theme, then this should be:

    <div id="header-logo"><a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/logo.png" alt="logo" /></a></div>

    IT all works perfectly. THANKS A LOT!

    So how would you do this if you’re using a child theme (I don’t want to have to do all this again when WP updates; I just made a child theme because I lost my edits when it updated automatically…)?

    I have a banner, but I don’t want the title (or description) to show above it. I have a feeling that I ought to know what to do; I’ve been re-reading this thread, but am not sure where to begin; I can’t even see where I would change:

    <?php $heading_tag = ( is_home() || is_front_page() ) ? ‘h1’ : ‘div’; ?>
    <<?php echo $heading_tag; ?> id=”site-title”>

    my site is http://www.dragon-a-day.com; any help you could offer would be appreciated.

    Moderator Michael

    @alchymyth

    Forum Moderator

    I have a banner, but I don’t want the title (or description) to show above it.

    it should be enough to add

    #site-title, #site-description { display:none; }

    to style.css of the child theme.

    (and maybe #header { padding-top:20px; } to reduce the space)


    if you rather change php code, you would need to copy header.php into the child theme, and edit it there.

    Thank you so much; it worked perfectly. I really appreciate it.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Removing title from twenty ten theme’ is closed to new replies.