Error message when changing header size

  • hbernard

    #1667

    I am trying to change the header image size to 960 x 281 px – I have followed the instructions at https://forum.graphene-theme.com/graphene-support/header-image-size-change

    However, when I put the following in the functions.php file I get the error message shown below. I’ve researched it and cannot find an answer. I am new at this, what do I have wrong? Thank you!

    <?php
    function graphene_custom_header_width(960){
    return 960;
    }
    function graphene_custom_header_height(281){
    return 281;
    }
    add_filter(960, 960);
    add_filter(198, 281);
    ?>

    Parse error: syntax error, unexpected T_LNUMBER, expecting ‘&’ or T_VARIABLE in /home/content/54/5656154/html/TMS/wp-content/themes/graphene-child-header/functions.php on line 2

    Mod

    Kenneth John Odle

    #16729

    Moved to support. Please read the forum rules.

    You do not need to include the header size in the parentheses, just after “return”. Don’t change the filter code, either.

    It should look like this:

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

    Be sure to put code between backticks. I have fixed this for you.

    Good luck,

    Ken

    hbernard

    #16730

    Ken – That’s awesome, thank you very much! It worked perfectly, I appreciate your help. – Harvey

    Mod

    Kenneth John Odle

    #16731

    You’re welcome.

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

You must be logged in to reply to this topic.