WordPress.org

Ready to get started?Download WordPress

Forums

Brunelleschi Header Size (7 posts)

  1. sbbn
    Member
    Posted 2 years ago #

    Hello! I am trying to make the header image size in Brunelleschi taller (the width is fine). I found a previous post by someone else that addresses this issue, but I had questions and didn't want to interrupt someone else's thread. The post is here:

    http://wordpress.org/support/topic/brunelleschi-142-header-font-issue?replies=2

    I'm pretty new and was wondering how to modify the header.php file in a child theme, as is suggested at the end of the answer. How do I replace the constant HEADER_IMAGE_HEIGHT with a literal value? I have no idea what to replace that constant with. Suggestions?

    Thanks!

  2. sbbn
    Member
    Posted 1 year ago #

    Can anyone help me with replacing that constant with a literal value? Thanks.

  3. Digital Raindrops
    Member
    Posted 1 year ago #

    Have a look at this post from Esmi, this is how you would do it in twenty eleven.

    But you would need to change the filtered function name

    function my_header_image_height($height) {
    	return 150;
    }
    add_filter( 'brunelleschi_header_image_height', 'my_header_image_height');

    HTH

    David

  4. sbbn
    Member
    Posted 1 year ago #

    EDIT: Thanks David, I think I figured it out. I changed this code:

    /* REQUIRED! -- define content width */
    if ( ! brunelleschi_option('content-width') ) { $content_width = 960; }
    else { $content_width = brunelleschi_option('content-width'); }
    
    /* Disable Based on Settings */
    if(brunelleschi_option('use-header-image') || brunelleschi_option('use-featured-content')) {
    
    	/* Define Default Header */
    	if ( ! defined( 'HEADER_IMAGE' ) ) { define( 'HEADER_IMAGE', '%s/images/headers/beach.png' ); }
    
    	define( 'HEADER_IMAGE_WIDTH', apply_filters( 'brunelleschi_header_image_width', $content_width ) );
    	define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'brunelleschi_header_image_height', 198 ) );
    
    	register_default_headers( array(
    		'beach' => array(
    			'url' => '%s/images/headers/beach.png',
    			'thumbnail_url' => '%s/images/headers/beach-thumbnail.png',
    			'description' => __('Beach', 'brunelleschi')
    		),
    		'fog' => array(
    			'url' => '%s/images/headers/fog.png',
    			'thumbnail_url' => '%s/images/headers/fog-thumbnail.png',
    			'description' => __('Fog', 'brunelleschi')
    		),
    		'grass' => array(
    			'url' => '%s/images/headers/grass.png',
    			'thumbnail_url' => '%s/images/headers/grass-thumbnail.png',
    			'description' => __('Grass', 'brunelleschi')
    		)
    	) );
    
    	/* Add Post Thumbnails */
    	add_theme_support( 'post-thumbnails' );
    
    	set_post_thumbnail_size( HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT, true );
    
    	if ( ! function_exists( 'brunelleschi_admin_header_style' ) ) :
    
    		/* Backend Header Style */
    		function brunelleschi_admin_header_style() { ?>
    			<style type="text/css">
    			#headerimg {
    				display: block;
    				margin: 0 auto;
    				margin-bottom: 17px;
    				border-top: 1px solid #aaa;
    				border-bottom: 1px solid #aaa;
    			}
    			</style>
    		<?php }
    	endif;
    	add_custom_image_header( '', 'brunelleschi_admin_header_style' );
    
    }

    You'll see it has the height as 198. I changed the value to 300 in the original functions.php file -- my mistake was forgetting the post I quoted in my original post said that it wouldn't work when doing this in a child theme file, and now it works! Kept a copy of the original functions.php, of course.

    But does this mean the header size change will get overwritten any time there is an update?

  5. sbbn
    Member
    Posted 1 year ago #

    I'm back because the change I made to the header didn't stick.

    As I mentioned above, I changed this in the code:

    define( 'HEADER_IMAGE_HEIGHT', apply_filters( 'brunelleschi_header_image_height', 198 ) );

    When I changed the 198 to 300 several days ago, it worked. When I went to check on my blog today it was back to 198 and no matter WHAT I change that code to, the image height stays at 198.

    Why did it change back? Is there ANYTHING I can do? If someone can help me please, I would very much appreciate it.

  6. sbbn
    Member
    Posted 1 year ago #

    I also wanted to mention that on the dashboard, when I go out to the Custom Header page, it SAYS 300 for the height and it shows a header which is 300 px tall, but if I use a 300 px tall image it gets scaled down to 198.

    So, this is my last attempt to ask: Does anyone know how to change the header size in Brunelleschi, or is it even possible?

  7. sbbn
    Member
    Posted 1 year ago #

    I'm just updating this in hopes someone can please answer!

    I've gotten the functions.php file in the child theme to work, so I'm no longer editing the original file. With the child theme functions.php it once again SAYS you can choose an image 300 px tall on the Custom Header page, but if I use a 300 px tall image it still gets scaled down to 198. It's as though changing the functions.php file only changes the text on the Dashboard page, not the actual image.

Topic Closed

This topic has been closed to new replies.

About this Topic