This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Unclickable images

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #48319
    webmaster123webmaster123
    Participant

    Hi,

    I made a annuaire using your Staff search and filter and i would like to make the results unclickable
    Is there a easy way ?

    #48321
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    Not via setting, but I think the simplest way is to use a bit of custom CSS:

    .asp_r, .asp_r * {
        pointer-events: none !important;
    }

    This should basically prevent any pointer type actions on the results container.

    #48409
    webmaster123webmaster123
    Participant

    Thx you, worked perfectly

    #48413
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    #48711
    webmaster123webmaster123
    Participant

    Hello,

    I did the review few weeks ago :))

    I would like to revive the subject.

    Indeed, I would like to ensure that the image at the back (which is the agent’s photo in a telephone directory) is correctly visible when hovering. This is not the case with this solution.

    If this is not possible, would it be possible to make the click allow the call (click-to-dial function). I have an attribute named {next_ad_int_telephone} that I can use for call ?

    #48715
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You are right, I think we need a different approach. Scratch that custom CSS, it’s not going to work.

    Instead, I have constructed a custom code for you. This will basically override all clicks, but nothing else and prevent any redirection.

    add_action('wp_footer', function() {
    	?>
    	<script>
    	window.addEventListener("load", () => {
    		document.querySelectorAll(".asp_main_container").forEach((el)=>{
    			el.addEventListener("asp_results_show", ()=>{
    				setTimeout(()=>{
    					WPD.dom('.item').off().on('click touchstart', (event)=>{
    						event.preventDefault();
    					});
    				}, 50);
    			});
    		});
    	});
    	</script>
    	<?php
    });

    Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.