WordPress.org

Ready to get started?Download WordPress

Forums

Removing title from twenty ten theme (13 posts)

  1. gregps
    Member
    Posted 3 years ago #

    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?

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    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...

  3. gregps
    Member
    Posted 3 years ago #

    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

  4. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    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;
    }
  5. carlacuomo
    Member
    Posted 3 years ago #

    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/

  6. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    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

  7. carlacuomo
    Member
    Posted 3 years ago #

    fantastic, thanks a lot!

  8. carlacuomo
    Member
    Posted 3 years ago #

    ...sorry but where do I insert my image logo?

  9. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    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>

  10. carlacuomo
    Member
    Posted 3 years ago #

    IT all works perfectly. THANKS A LOT!

  11. graphitegolem
    Member
    Posted 2 years ago #

    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.

  12. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    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.

  13. graphitegolem
    Member
    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.