no featured image then a default image

Home Forums Calendar Products Events Calendar PRO no featured image then a default image

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #803399
    alonso
    Participant

    how can I change the template that is if no featured image is selected, a default image displayed

    #807498
    Brian
    Member

    Hi alonso,

    Thanks for using our plugin.

    I can help you get started on this and then you should be able to take it from there.

    You are going to want to follow our Themer’s Guide for this customization:

    https://theeventscalendar.com/support/documentation/events-calendar-themers-guide/

    For the Single Events you want to find this file and move it to your theme according to the themer’s guide”

    \the-events-calendar\views\single-event.php

    Then look for this line:

    <?php echo tribe_event_featured_image( $event_id, ‘full’, false ); ?>

    That is what you will have to modify to add a default image.

    If you get stuck let us know, but for the most part this customization is beyond the support we can give on the forum from here.

    Thanks

    #807872
    alonso
    Participant

    i find this like google

    if(has_post_thumbnail()) {
    the_post_thumbnail();
    } else {
    echo ‘‘;
    }

    can you help me adapt your code, unfortunately I lack some php knowledge

    #808213
    Brian
    Member

    Sure I can help out the next step, but then you are going to have to take it from there.

    I would do something like this:

    <?php if(has_post_thumbnail($event_id)) {

    echo tribe_event_featured_image( $event_id, ‘full’, false );

    } else {

    echo 'default image html';

    } ?>

    That works for me so you will have to take it from here to show the image you would like. Just replace “default image html” with your html tags for the image. This is about all we can provide for this customization it is close and with a little work you should be able to get it how you would like. 🙂

    Thanks

    #810614
    alonso
    Participant

    thank you it is great thanks for the help

    #810874
    Brian
    Member

    Great glad you got it working. If you run into trouble or have a new question please create a new ticket as I am going to close this as the original question has been answered.

    Thanks

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘no featured image then a default image’ is closed to new replies.