• Resolved konexys

    (@konexys)


    Dear friends,

    I’ve tried by all ways to make the recent ads ad div clickable (like on ads listing), instead of the ad title only, but nothing works.

    Can someone help?

    Shouldn’t this be fixed on the default version?

    Best regards,
    David Duarte

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    right now we are not really planning to change the clickable area in the recent ads widget.

    If you would like to have the whole recent item clickable then you would need to open file wpadverts/includes/class-widget-ads.php go to line about 473 and change the line

    
    <div class="<?php echo adverts_css_classes( 'adverts-widget-recent', get_the_ID() ) ?>">
    

    to

    
    <div onclick="location.href='<?php the_permalink() ?>'" style="cursor:pointer" class="<?php echo adverts_css_classes( 'adverts-widget-recent', get_the_ID() ) ?>">
    

    Note that this change will be overwritten on WPAdverts update, so make sure to backup it and redo after WPAdverts update.

    If i will find some free time i will try to come up with some code snippet for this which will not be overwritten on the update.

    Thread Starter konexys

    (@konexys)

    Hello Greg,

    Thank you very much for the ultra fast reply.

    I’ve tested your code, but I loose all the widget css format.

    Do you have another suggestion?

    Best regards,
    David Duarte

    Plugin Author Greg Winiarski

    (@gwin)

    Are you sure you have the code added correctly? It will not remove any CSS formatting as the only thing it does is that it makes the main div clickable and changes the cursor to indicate the div can be clicked.

    Thread Starter konexys

    (@konexys)

    Greetings Greag,

    I copied and pasted the code again, and it is ok now. Maybe sometime was missing…

    Thank you very much.

    I love your script.

    Take care.
    David Duarte

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Recent Ads Widget – Make all the div clickable’ is closed to new replies.