• andreasTypo

    (@andreastypo)


    Hi,

    I’m using the illdy theme by colorlib ( https://colorlib.com/wp/themes/illdy/ )

    It has a jumbotron support for the HP and header image support for the underlying pages.
    However, I’m trying to add support so that I still have the jumbotron feature on the homepage, then check if a page/blog has a featured image and use this.
    If no featured image is found, use the general header image.

    I’m not all that good with php so I’m struggling with this issue.

    This is the current header (style tag that needs to be edited I presume?):

    <header id="header" class="<?php if( is_front_page() ): echo 'header-front-page'; else: echo 'header-blog'; endif; ?>" style="background-image: url('<?php if( is_front_page() ): echo ( ( $jumbotron_general_image ) ? esc_url( $jumbotron_general_image ) : '' ); else: echo esc_url( get_header_image() ); endif; ?>');">

    I guess I have to add something like this in between

    <?php if( has_post_thumbnail() ): ?>
    			<?php the_post_thumbnail( 'illdy-blog-list' ); ?>
    <?php endif; ?>

    But not sure how to write it so it works as IF ELSEIF ELSE

    Thanks in advance for pointers

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add featured image support to header’ is closed to new replies.