WordPress.org

Ready to get started?Download WordPress

Forums

Unique Headers
[resolved] how to get this plugin working with a cherry framework childtheme? (22 posts)

  1. eX1337
    Member
    Posted 4 weeks ago #

    Im using the latest version of the cherr framework with a child theme and wanted to set a custom header for each post/site.

    No Plugin is working because my theme doesnt support custom headers and i cant get this working.

    I tried to add

    $args = array(
    	'flex-width'    => true,
    	'width'         => 980,
    	'flex-height'    => true,
    	'height'        => 200,
    	'default-image' => get_template_directory_uri() . '/images/header.jpg',
    );
    add_theme_support( 'custom-header', $args );

    into header.php/index.php/functions.php, but no change at all.

    childtheme-header.php: http://paste2.org/BbXV14kn
    cherryframework-functions.php: http://paste2.org/zPf06j4m

    https://wordpress.org/plugins/unique-headers/

  2. Ryan Hellyer
    Member
    Plugin Author

    Posted 4 weeks ago #

    You don't seem to have any code in your header.php for adding the custom headers.

  3. eX1337
    Member
    Posted 4 weeks ago #

    yes, i posted the content of the original header.php because it didnt had any effect - no matter wherever i paste this code.

  4. Ryan Hellyer
    Member
    Plugin Author

    Posted 4 weeks ago #

    Oh, you mean the code you posted inside your comment above? That would belong in your functions.php file (usually), but you also need code in your header.php file to actually load the header. The code you posted simply tells WordPress that your theme supports custom headers, it doesn't actually display the header.

  5. eX1337
    Member
    Posted 4 weeks ago #

    So, how can i display it using header.php? the structure of my theme is confusing me a lot tbh and im not really experienced in php.

    there is a static header image in my theme called "bg_header.jpg" but i dont know how its beeing loaded.

  6. Ryan Hellyer
    Member
    Plugin Author

    Posted 4 weeks ago #

    Throw this into your header.php file and see what happens :)

    <img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="" />

    This chunk of code might by why you are confused when looking in your header.php file. It's calling another PHP file which it loads at that point.
    <?php get_template_part('wrapper/wrapper-header'); ?>

  7. eX1337
    Member
    Posted 4 weeks ago #

    Wow, thanks for the Answer!

    I pasted your code into header.php with no result. But if i paste this code into my wrapper-header.php it works!

    Thanks a lot.

  8. Ryan Hellyer
    Member
    Plugin Author

    Posted 4 weeks ago #

    Were you pasting into the parent themes header.php file by any chance? If you did that, then it would be overruled by the child theme file instead.

  9. eX1337
    Member
    Posted 4 weeks ago #

    I tried both header.php-Files, but it didnt work for me.

    Can u tell me where the "get_custom_header()->width/height" is set?

    If i change the dimensions via the wordpress mediathek it doesnt have any effect. So, the picture is visible now but it's really small. Much smaller then the original image-file.

  10. Ryan Hellyer
    Member
    Plugin Author

    Posted 4 weeks ago #

    You posted the code for that in your first post ;) It's the bit you put in your functions.php file.

  11. Ryan Hellyer
    Member
    Plugin Author

    Posted 4 weeks ago #

    You can just remove that height altogether and rely on the browser working out the height of course. This is often preferable if it needs to expand and contract to mobile browser widths.

  12. eX1337
    Member
    Posted 4 weeks ago #

    Im unable to do that :-/

    If im trying to paste the code of my first post into header.php or wrapper-header.php it doesnt change anything.

    even if i just use ur code <img src="<?php header_image(); ?>" height="600" width="1500" alt="" />

    it doesnt change the imagesize - its still really small. (the picture is 1700 x 803)

  13. Ryan Hellyer
    Member
    Plugin Author

    Posted 4 weeks ago #

    Oh, so you want to increase the actual size of the physical image? In that case you'll need to edit the code in your functions.php file.

  14. eX1337
    Member
    Posted 4 weeks ago #

    'physical image'? i just want to get this image displayed in full size. take a look at my testpage: http://arnohenkel.de/malimed/we/testi/

    and i dont see attributes for that in my functions.php-file / i cant use the code above.

    i would love to employ u for that but ive already read that u dont do paid jobs D:

  15. Ryan Hellyer
    Member
    Plugin Author

    Posted 3 weeks ago #

    You don't need to pay me, we can figure this out :)

    I'm assuming this is the image you are stuck on? It's huge, but not rendering correctly on your site due to some CSS.

    http://arnohenkel.de/malimed/wp-content/uploads/2014/06/header1.png

    If you want to pay someone to fix this, I can send some other devs to come help if you like. This should be fairly easy to get working.

  16. eX1337
    Member
    Posted 3 weeks ago #

    oh, nice to know it wasnt straight my fault this time :P

    sounds good, can i chat with them somehow? they can contact me via "1337johnwayne@gmail.com" too.

  17. Ryan Hellyer
    Member
    Plugin Author

    Posted 3 weeks ago #

    I didn't have anybody in particular in mind, I'll just dump a message out on Twitter and you will hopefully get some people emailing you about it.

  18. eX1337
    Member
    Posted 3 weeks ago #

    aight, go for it then :)

  19. Ryan Hellyer
    Member
    Plugin Author

    Posted 3 weeks ago #

  20. builtbyrobert
    Member
    Posted 3 weeks ago #

    Hi,

    It looks like you have your image in a div of class "span3" which has a width set of 270px or 220px depending on the screen size. Due to the width of the container being restricted, this is forcing the size of the image to be reduced to maintain the aspect ratio.

    Maybe put the image in a new div of say class "header__image" or add another class to the div to contain the image?

  21. eX1337
    Member
    Posted 3 weeks ago #

    Wow, that happens because i had no clue what im doing.

    It works - thanks both!

  22. eX1337
    Member
    Posted 3 weeks ago #

    edit: nvm, got it :)

Reply

You must log in to post.

About this Plugin

About this Topic