Twenty Ten Theme Customization

Posted: July 23, 2010 in PHP
Tags: , ,

How to change header image width and height?

It is very easy to change the header image’s width and height. Goto 2010 theme folder and open the functions.php file. Go to line no 110 and 111, you can see this code

define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 940));
define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 198) );

Change 940 and 198 according to customize header’s width and height. Eg.

define( 'HEADER_IMAGE_WIDTH', apply_filters( 'twentyten_header_image_width', 960 ) );
define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'twentyten_header_image_height', 225 ) );

How to change header image path?

Go to line no 106 in theme’s functions.php file and edit the following code according to customize header image path. Default is


define( 'HEADER_IMAGE', '%s/images/headers/path.jpg' );

How to off the home tab or rename the home name?

Get rid of Home link:

<?php
 function twentyten_page_menu_args( $args ) {
 $args['show_home'] = false;
 return $args;
}
?>

Rename the Home link:

$args['show_home'] = "Hjem";

This function also exists in functions.php file.

Change excerpt length?

function twentyten_excerpt_length( $length ) {
 return 40;
}

Change 40. Like return 60;.

Advertisements
Comments
  1. fikirbaz says:

    Thanks for your tips… I really tried hard to find how to rename the home link…

    Here is another situation: I wanna add a custom link to the menu. How can I do this without using custom menus but using default menu?

    Thanks

  2. 5thdarvesh says:

    THNXX……

    me too searched really hard for Home.
    one more thing, how can i change the text saying “Leave a Reply” in the comment form..?
    i had translated the theme using the default .mo file given with the theme. The other statements in the comment form are also not there… i will really appreciate ur help.

    ~5th Darvesh

    • chinmoy29 says:

      @5th Darvesh

      Glad for my article help you.

      You can easily change the text. Try this code

      	comment_form(array('title_reply' => 'Reply'));
      

      You can found this function in wp-includes/comment-template.php file(line no 1484).

      Thanks
      chinmoy

      • 5thdarvesh says:

        Thnx for the reply chinmoy.
        But as I m a newbee to PHP and don’t understand much about this stuff. Would u please tell me very specifically what should I change and where…. coz, what i found in line 1484 is:
        function comment_form( $args = array(), $post_id = null ) {
        and then it goes on… after that there are the default strings which I want to change actually (line# 1508). I tried by changing the strings but then this creepy ‘?’ type character appears on the page, after reloading.
        P.S: I want to translate in Urdu language, is this the problem with Arabic/Persian script??

        ~5th Darvesh

        • chinmoy29 says:

          hi 5th Darvesh,

          don’t edit wp-includes/comment-template.php file. You will edit the twenty ten theme’s comments.php file. Go to line no 77 and edit this function

          <?php comment_form(); ?>

          with

          <?php comment_form(array('title_reply' => 'Reply')); ?>

          “Reply” will be changed according to your choice.

          Thanks
          chinmoy

      • 5thdarvesh says:

        huh……. why didn’t I thought this before..!!
        It was the problem with the encoding, now it is solved as i selected utf-8.

        Thanx for ur solution.

        ~5th Darvesh

  3. 5thdarvesh says:

    Thanx Chinmoy,
    now i got it all.
    Hats Off to u 🙂

    ~5th Darvesh

  4. Christian says:

    Worked for me. Thanks for the help!

  5. Casey G. says:

    Hi on my site the “leave a comment” text is really small and i want to try to seperate it or at least make it bigger than all of my tags/categories… how could i do this?

    • chinmoy29 says:

      Hey Casey,

      Add following css in your style.css (after this block

      .entry-utility {
      color: #888;
      font-size: 12px;
      line-height: 18px;
      clear: both;
      }

      )

      .entry-utility .comments-link{font-size: 14px;}

      Modify the “font-size: 14px” property according to your choice e.g “font-size: 16px”.

      Cheers 🙂

  6. Slavo says:

    I changed the header image and it works like a charm for the default header (700×220), but when i want to add a custom header image in the edit page section it still uses the default image size/proprtions (940×198) but it shrinks it to the new width(700) but the height is a ratio of the old banner images (148) and not 220 as i have set it.

    and that wrong height messes up my layout.

    • chinmoy29 says:

      you see this section “How to change header image width and height?” properly. First read my article properly. Hope it will solve your issue. You just change the WIDTH and HEIGHT from functions.php file.

  7. Mike says:

    Thanks a million, you’re the first hit I got from google that actually explained this customisation properly. Appreciate it.

  8. 監視器 says:

    Excellent post, l quite agree with your conclusion. However lam having problem subscribing to your rss.

  9. mark says:

    Any idea on twenty ten how to move the header above the wrapper? Ie, have the header outside of the wrapper area???

    Thanks..

  10. Alexander says:

    Thanks, really helpful! However when trying to change the image width, it’s only changed on the right side.. How can I change the width on the left side of the image as well? Thanks and best wishes.

  11. Nat says:

    Thanks. I have a new Blog and my visitors were having a hard time finding the comment section. I changed the text and size. Thank you.

  12. boomburgers says:

    Hi Chinmoy!

    Thanks for this post — just wondering if you can change the header dimensions to “100%” or something that will make the header full screen?

    Thanks much.

    • chinmoy29 says:

      Hi boomburgers,

      If you change header dimensions to 100% then your design you will be messed up. That time you will need to modify the CSS and increase the wrapper width also.

      If you can do that then there have no problem to make the header full screen.

      Thanks-Chinmoy
      Marketing Ads & Seo

  13. boomburgers says:

    Hi Chinmoy,

    Thanks much for that! So I change it to 100% for both width and height? And do I modify the wrapper width to 100%, too?

    Thanks again for your help.

  14. LSC says:

    Hi Chinmoy, thank you so much your website is very helpful.

    i wanted to ask if it is possible to make the white page on top of the background a different colour, or even tile it (x,y) with a custom background.

    the white is kinda plain looking and I think i want to have a light watermark in the background behind all the text

    • chinmoy29 says:

      HI,

      Yes. You can do it. You will modify the styles.css file and file is located in your activated theme folder. I am selling a testimonials plug-in. If you love it then you can buy it. Or I have a site http://www.marketingadsandseo.com there you can post any marketplace article and you can post any ads(banner image) at sidebar or header.

      Thanks
      Chinmoy

  15. The Dame says:

    This is fantastic thank you! Except how do I get rid of the black line above my header!?

  16. franasia says:

    Thank you for all your tips!

    I’m looking for a way to rearrange page tabs.

    Any help greatly appreciated.

    Cheers

  17. Hi, I found this by searching for how to change the Home title on my blog. I see your directions here, but I don’t really understand what I am supposed to do to change the title. Sorry, I am new to this and do not understand html. Can you help me? I want Home to read as 365Danbury instead of Home. I tried using what you have above and changed it to this:
    $args[‘show_home’] = 365Danbury;
    in the functions.php

    That did not work and I got an error page. eek! Can you tell me exactly what I am supposed to change?

    http://www.365danbury.com

  18. This is the error I am getting no matter where I go on my site. I didn’t save the original code, so I don’t know how to change it back. Help!

    Parse error: syntax error, unexpected T_STRING in /home/danbury3/public_html/wp-content/themes/twentyten/functions.php on line 222

    • chinmoy29 says:

      Whole code would be like this

      <?php
       function twentyten_page_menu_args( $args ) {
       $args['show_home'] = "365Danbury";
       return $args;
      }
      ?>
      
      • Great, thanks so much for your help! Can I put this somewhere else to get my functions.php back? I cannot get in there now. 😦

        • chinmoy29 says:

          Save as current file like this functions.php_bkp and upload the fresh file on your server. If you have no old file then extract the existing zip file or download the zip file from http://www.wordpress.org and copy the file from twenty ten theme’s folder.

          Have A Nice Day…… 🙂

          Thanks
          Chinmoy
          Marketing Ads & Seo

      • Hi again! I got my site fixed. The ‘Home’ link is gone now. I just have About and Contact. If I paste the above code into function.php, will that give me a 365Danbury link on my menu next to About and Contact? thanks!

        • chinmoy29 says:

          Hi,

          First search this function twentyten_page_menu_args in functions.php file then replace this line $args['show_home'] = true; with $args['show_home'] = "365Danbury";

          Thanks.

  19. Okay, I did that and I did not get an error and everything is still working fine, thankfully. However, I didn’t get a link on my menu for 365Danbury. Any ideas?

  20. MayClem says:

    *IMPORTANT NOTE*

    If you change the width of the HEADER, make sure to change the widths of the WRAPPER and the ACCESS styles

  21. Rachel says:

    Thank you loads, this is the best post I ever found in the topic of customization. But I need to change the leave a reply to just share your experience. the issue is that I don’t want that share your experience becomes the default text for all comment forms, only for the page for college life and disability page. If I change in functions.php it will be the text for all comment forms of every page that allows comments, right? I appreciate any help!

    • chinmoy29 says:

      Hi Rachel,

      Use condition like this:

      if(is_page('college-life')):
            comment_form(array('title_reply' => 'leave your experience'));
      else
           comment_form();
      endif;
      
  22. aBEL Rubella says:

    how about change word “Reply” to a any comment?

  23. aBEL Rubella says:

    comment_reply_link( array_merge( $args, array( ‘reply_text’ => ‘balas komen ini..’, ‘depth’ => $depth, ‘max_depth’ => $args[‘max_depth’] ) ) );

    I tried to put img src code, but not working. Can someone guide me on how to put image for the comment_reply_link?

  24. aBEL Rubella says:

    thanks for help.. 🙂

  25. aBEL Rubella says:

    and where to find cancel_comment_reply_link for 2010 theme?

    I found that “Cancel Reply” isn’t nice.. i want change them..

  26. use

    comment_form(array('cancel_reply_link' => 'your own code'))
  27. aBEL Rubella says:

    can you guide me?

    <?php comment_form(array('title_reply' => '<img src="http://farm6.static.flickr.com/5141/5684407114_017863489d_o.gif" />')); ?>

    where to put the cancel_reply_link ?

  28. aBEL Rubella says:
    <?php comment_form(array('title_reply' => 'my comment code','cancel_reply_link' => 'my cancel code>')); ?>

    thanks.. it’s working now 🙂

  29. […] <?php function twentyten_page_menu_args( $args ) { $args['show_home'] = false; $args['show_home'] = "Blog"; return $args; } ?> Adapted from: https://chinmoy29.wordpress.com/2010/07/23/twenty-ten-theme-customization/ […]

  30. Susie says:

    Hello. My problem is that I have two Home pages on my WordPress blog; the default named ‘Home’ and another page I created called ‘My New Home Page” which has all my static text written in it. I went through your material above on how to get rid of the default Home link by changing in function.php like this:

    function twentyten_page_menu_args( $args ) {
    3 $args[‘show_home’] = true;
    TO
    function twentyten_page_menu_args( $args ) {
    3 $args[‘show_home’] = false;

    But nothing changed. I still have two Home Pages. What am I doing wrong?

  31. 2010_theme_user says:

    Thank you so much for posting this information!

  32. Susie says:

    Thanks sooo much for fixing my duplicate Home page dilemma. Couldn’t have done it without you! I don’t know how you did it, but I’m glad you did. I posted a Testimonial. Hope it went through cause the little wheel kept spinning after I clicked Send. Let me know if it didn’t and I’ll try to re-post.
    Another problem if you please. Thanks in advance. I have searched high and low trying to figure out why my wordpress page text does not show below the post/page title except when clicking Category in the side panel. What is the purpose of having Nav Bar pages across the top if none of the page text shows? Can you help me? Where can I go in my Dashboard to fix this problem? Thanks EVER so much! Susie

  33. uneek82 says:

    Hello i have been trying to post this code:

    1 $args[‘show_home’] = “new”;

    ive also tried this code:

    1

    to replace my “home” name to new.

    everytime i save the functions.php and reload my page, my page just comes up blank. Doesnt seem to like this code. i have edited my banner size with this code and it works fine:

    any ideas why i can my code in functions.php is not working? thanks

  34. uneek82 says:

    yes im using the custom size image header code.

  35. I believe you are right completely

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s