• Resolved njryan20

    (@njryan20)


    The theme I am using generates a header image in the header.php file which is called in all page templates. The code in the header.php file looks like this:

    <div class="header-area" data-parallax="scroll" data-image-src="<?php echo wp_get_attachment_url( get_post_thumbnail_id($post->ID)); ?>">

    Because the IDX pages are generated dynamically, I am unable to set a featured image and the result is a large white space above the fold where the image should be.
    ex.) https://www.pagosalandcompany.com.php56-3.ord1-1.websitetestlink.com/homes-for-sale-details/EPR-LOT9-RAPTOR-PLACE-PAGOSA-SPRINGS-CO-81147/710887/392/

    I have been trying different ways to set a default featured image. I installed the Default Featured Image plugin with no luck. I am new to php, and have tried replacing the above php code in the header.php file with:

    <?php if ( has_post_thumbnail() ) {
    the_post_thumbnail();
    } else { ?>
    <img src="<?php bloginfo('cafe-soux'); ?>/img/default-image.jpg" alt="Pagosa Land Company" />
    <?php } ?>

    I have the default image in the ‘img’ folder within the cafe-soux theme folder. This fix does not display any header images what so ever.

    Is there a mistake in my php code or any other solution I can pursue to solve this issue?

    Thank you

    https://www.ads-software.com/plugins/optima-express/

Viewing 1 replies (of 1 total)
  • Plugin Author iHomefinder, Inc.

    (@ihomefinder)

    Hello,

    The IDX Pages use the theme template that is set within WordPress > Optima Express > IDX Pages (Theme template). Since the output of the IDX Page uses the theme’s template, it will the page will include functions called such as for getting the side bar, header, etc.

    Unlike regular wordpress posts, the IDX pages are virtual and do not include a feature to add a featured image. You may need to create a custom template that does not include the call to get the featured image. I’ve included our knowledgebase article that includes some sample template code below, that you may find helpful.

    https://support.ihomefinder.com/index.php?/Knowledgebase/Article/View/92/0/theme-templates

    If you have any questions or need additional assistance, please feel free to email [email protected].

Viewing 1 replies (of 1 total)
  • The topic ‘default featured image on IDX pages’ is closed to new replies.