Header Image Size Change

  • serisys

    #108

    I’ve picked the graphene theme because it looks great and you seem to have put some unique thought into it – great job! I’m code knowledgable but not an expert.

    I’d like to change the existing header image size. I know the CSS needs changing which I did;

    #header{

    background-color:#000;

    background-repeat:no-repeat;

    height:250px;

    margin-left:16px;

    width:500px;

    }

    But now I need to get around the auto image crop & upload code.

    Any suggestions or could you point me in the right direction?

    Thanks Syahir.

    Phil

    Admin

    Syahir Hakim

    #11256

    In addition to changing the CSS codes you mention above, you also need to change several parameters. By using a child theme, put this code into functions.php file in your child theme:

    <?php
    function graphene_custom_header_width(){
    return 900;
    }
    function graphene_custom_header_height(){
    return 198;
    }
    add_filter('graphene_header_image_width', 'graphene_custom_header_width');
    add_filter('graphene_header_image_height', 'graphene_custom_header_height');
    ?>

    Change the values inside the functions to the corresponding width and height that you want.

    Note that this code in untested, but it should work. Let me know if you run into any problem.

    serisys

    #11257

    Thanks Syahir… That did it! Picture upload and crop all works.

    graphene-child

    style.css (as my post above)

    function.php (as your post above with my values)

    Before I head to the donate button (as everybody should), what is the best way to add a widget into the header?

    Many thanks.

    Phil

    Admin

    Syahir Hakim

    #11258

    The easiest way I can think of right now without modifying the theme’s codes is by defining your own widget area in the child theme’s sidebar.php, create a function that displays the widget area, hook that function to one of the action hooks available with the theme, and then use CSS absolute positioning to position the new widget area you just define.

    Not exactly easy, I know, but doable 🙂

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.