Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #385572

    Hi there,

    I’ve been playing around with custom functions to display content before the header and trying to perhaps either use this as an image (div) or as the post background??

    Example:

    function after_head_image_func($content){
    if(is_home())
    echo ‘<div class=”header-banner”>header banner</div>’;
    elseif(is_page())
    echo ‘<div class=”header-banner”>header banner</div>’;
    elseif(is_single())
    echo ‘<div class=”header-banner”>header banner</div>’;
    elseif(is_category())
    echo ‘<div class=”header-banner”>header banner</div>’;
    }
    add_action(‘ava_after_main_container’, ‘after_head_image_func’);

    My problem is that I have no idea how to incorporate the hook for the featured image on the post? I think I’ve tried everything and yet the only thing that seems to work for me is to hard code an image into this functions.php (not a solution!!)

    I’m using a child theme and have this as a custom function file.

    Any help would be greatly appreciated, I’m hitting my head against a wall!! :(

    Kind regards,
    Dan

    #386484

    Hi danwin7!

    I think one of these plugins could be helpful to you:
    https://wordpress.org/plugins/custom-header-extended/
    https://wordpress.org/plugins/custom-header-images/

    Hope that helps.

    Best regards,
    Andy

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.