How to change size of the logo?
  • Changing the size of custom header (your logo)

    Before we start, please make sure that you are not editing /shell-lite/ Theme files directly, if you do your customizations will not be protected when updates are made.

    Personal customizations with Child Theme

    Create a new file called functions.php and save it in /shell-child-theme/. Open you Child Theme's functions.php and paste this:
    <?php
    /**
    * Fire up the engines boys and girls let's start theme setup.
    */
    add_action('after_setup_theme', 'shell_setup');

    if (!function_exists('shell_setup')):

    function shell_setup() {

    global $content_width;

    /**
    * Global content width.
    */
    if (!isset($content_width))
    $content_width = 550;

    /**
    * Shell is now available for translations.
    * Add your files into /languages/ directory.
    */
    load_theme_textdomain( 'shell', TEMPLATEPATH . '/languages' );

    $locale = get_locale();
    $locale_file = TEMPLATEPATH . "/languages/$locale.php";
    if ( is_readable( $locale_file ) )
    require_once( $locale_file );

    /**
    * Add callback for custom TinyMCE editor stylesheets. (editor-style.css)
    * @see http://codex.wordpress.org/Function_Reference/add_editor_style
    */
    add_editor_style();

    /**
    * This feature enables post and comment RSS feed links to head.
    * @see http://codex.wordpress.org/Function_Reference/add_theme_support#Feed_Links
    */
    add_theme_support('automatic-feed-links');

    /**
    * This feature enables post-thumbnail support for a theme.
    * @see http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
    */
    add_theme_support('post-thumbnails');

    /**
    * This feature allows users to use custom background for a theme.
    * @see http://codex.wordpress.org/Function_Reference/add_custom_background
    */
    add_custom_background();

    /**
    * This feature adds a callbacks for image header display.
    * In our case we are using this to display logo.
    * @see http://codex.wordpress.org/Function_Reference/add_custom_image_header
    */
    define('HEADER_TEXTCOLOR', '');
    define('HEADER_IMAGE', '%s/images/default-logo.png'); // %s is the template dir uri
    define('HEADER_IMAGE_WIDTH', 300); // use width and height appropriate for your theme
    define('HEADER_IMAGE_HEIGHT', 100);

    define('NO_HEADER_TEXT', true);

    // gets included in the admin header
    function shell_admin_header_style() {
    ?><style type="text/css">
    #headimg {
    border: none !important;
    width: <?php echo HEADER_IMAGE_WIDTH; ?>px;
    height: <?php echo HEADER_IMAGE_HEIGHT; ?>px;
    }
    </style><?php
    }

    add_custom_image_header('', 'shell_admin_header_style');

    register_nav_menu( 'primary', __( 'Primary Menu', 'shell' ) );
    }

    endif;
    ?>

    Now that you have this in your Child Theme, simple adjust the numbers 300 and 100 to fit your needs.

    That is all. Save again and upload to your server.

    Note: Please do not copy and paste an entire functions.php

    Download an example of functions.php - (zip file)
This discussion has been closed.
All Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

    Most Popular This Week