Widget Blog Teaser: Make whole picture not just title clickable/to a link

Hello,

May I ask you if it's possible to link the whole blog teaser image and not just only the title of the blog teaser?

Looking forward to an answer. Thanks for your help!

Best regards
Fabian

Comments

  • Hi,
    Please always attach a link so we can check it out. If the page is offline(localhost) then our help will be limited, you will have to contact us when the page is online. Also please make sure that the page is not under maintenance before you provide us the link.
    It is always a good idea to also attach a screenshot, for that use services like snag.gy or pasteboard.co
    thanks
  • Hi Pablo,

    thanks for your answer. Please find the link to our website with blog teaser widget: http://bit.ly/2L6clmE

    All the best
    Fabian
  • Hi,
    Sorry but this is not possible.
    It require a HTML edit of the Theme which we do not support.
    Cheers.

  • Hi FabiK - it is possible. Just add this code to Betheme > Theme Options > Custom JS & CSS > JS

    jQuery(function($) {

    $('.blog-teaser li .photo-wrapper').on( "click", function(e) {
          e.preventDefault(); 
         window.location.href=$(this).parent().find('.post-title a').attr('href')
    });

    $('.blog-teaser li .desc-wrapper').on( "click", function(e) {
          e.preventDefault(); 
         window.location.href=$(this).find('.post-title a').attr('href')
    });

    });
  • @kemota Thank you for the code . It works very well. 10/10 ?️

    I add a css code to change the cursor. Betheme > Theme Options > Custom JS & CSS > CSS

    .blog-teaser li .photo-wrapper, .blog-teaser li .desc-wrapper .desc {

    cursor: pointer;

    }

Sign In or Register to comment.