Forum Replies Created

Viewing 4 replies - 16 through 19 (of 19 total)
  • Thread Starter TyMcClendon

    (@tymcclendon)

    When I try pasting in the code Ov3rfly provided, dreamweaver throws a syntax error out. When I try accessing the dashboard, I get a 404 error. When I try accessing the front end of the site, I get the following error:

    Parse error: syntax error, unexpected T_FUNCTION in /home/mcclendo/public_html/newsongsdaily.com/wp-content/themes/twentyeleven-child/functions.php on line 34

    This line points to the add_filter functions provided by Ov3rfly.

    I simply replaced these two lines of code with Ov3rfly’s code.

    define( ‘HEADER_IMAGE_WIDTH’, apply_filters( ‘twentyeleven_header_image_width’, 1000 ) );
    define( ‘HEADER_IMAGE_HEIGHT’, apply_filters( ‘twentyeleven_header_image_height’, 100 ) );

    If I remove all of the “if ( ! isset( $content_width ) )” code, and leave only the 2 lines of add_filter script, the same issue occurs as explained above in this reply.

    Thread Starter TyMcClendon

    (@tymcclendon)

    Thank you for your help.

    I’ve been able to successfully adjust the height.

    Have a nice day,

    Ty

    Thread Starter TyMcClendon

    (@tymcclendon)

    Thanks for the help.

    I’ve copied all the code to edit the post_theme_setup function, but it still does not change the actual size of the header on the website’s front end. The dashboard reads the dimensions 1000 x 100, but the displayed image’s height is still much larger.

    The only solution I have is to set the height in css to 100, which works. But I’d like to resolve this issue completely and I don’t think my fix is efficient enough.

    This is the code in my child theme’s functions.php file:
    <?php
    // It’s a new layout make the content wider
    if ( ! isset( $content_width ) )
    $content_width = 940;

    /** Tell WordPress to run post_theme_setup() when the ‘after_setup_theme’ hook is run. */
    add_action( ‘after_setup_theme’, ‘post_theme_setup’ );

    if ( !function_exists( ‘post_theme_setup’ ) ):
    function post_theme_setup() {

    // The height and width of your custom header.
    // Add a filter to twentyeleven_header_image_width and twentyeleven_header_image_height to change these values.
    define( ‘HEADER_IMAGE_WIDTH’, apply_filters( ‘twentyeleven_header_image_width’, 1000 ) );
    define( ‘HEADER_IMAGE_HEIGHT’, apply_filters( ‘twentyeleven_header_image_height’, 100 ) );

    /* 1140 Remove Headers */
    function child_remove_twenty_eleven_headers(){
    unregister_default_headers( array(
    ‘wheel’,
    ‘shore’,
    ‘trolley’,
    ‘pine-cone’,
    ‘chessboard’,
    ‘lanterns’,
    ‘willow’ ,
    ‘hanoi’)
    );
    }
    add_action( ‘after_setup_theme’, ‘child_remove_twenty_eleven_headers’, 11 );
    }
    endif;
    ?>

    Thanks.

    Ty

    Thread Starter TyMcClendon

    (@tymcclendon)

    When I try to access the dashboard, I get the following error and cannot log in:

    Warning: Cannot modify header information – headers already sent by (output started at ../wp-content/themes/twentyeleven-child/functions.php:6) in ../wp-includes/pluggable.php on line 866

    To fix this, I tried adding:

    remove_filter( ‘HEADER_IMAGE_WIDTH’, ‘twentyeleven_header_image_width’ );
    remove_filter( ‘HEADER_IMAGE_HEIGHT’, ‘twentyeleven_header_image_height’ );

    But it didn’t work. The only way to access the admin panel is to remove the functions.php file.

    Any suggestions are appreciated.

    Ty

Viewing 4 replies - 16 through 19 (of 19 total)