Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1239217

    Hello,

    With mansonry the anchor is on all the text under the images and anchor is on the image.
    The text under the image is by default the title of the post link (href) and begin of the text of the post link.
    Is it possible to set up the anchor only on the title of the post and image ? possibilty to click on image or title only but not on the text (not href in the text under title).

    Best regard
    cm

    • This topic was modified 4 years, 3 months ago by ChrisCoach.
    #1240686

    Hey ChrisCoach,

    Thank you for the inquiry.

    Would you like to disable the link of the image in a masonry item? This is possible but we have to add an additional script. Please try this snippet in the functions.php file.

    add_action('wp_footer', function() {
    ?>
    <script>
    (function($) {
        $('.av-masonry-entry').on('click', function(e) {
             if($(e.target).hasClass('av-masonry-image-container')) {
                 e.preventDefault();
             }
        });
    })(jQuery)
    </script>
    <?php
    }, 999);
    

    Best regards,
    Ismael

    #1240701
    This reply has been marked as private.
    #1241601

    Hi,

    Thank you for the clarification.

    We can still use the same script above, but we’ll target the masonry content instead of the featured image.

    Please look for this line:

    if($(e.target).hasClass('av-masonry-image-container')) {
    

    Replace it with:

    if($(e.target).hasClass('av-masonry-entry-content')) {
    

    Best regards,
    Ismael

    #1241835
    This reply has been marked as private.
    #1242523

    Hi,

    Thank you for the update.

    I think normally the cursor have to be an arrow if it is not clickable.

    Add this css code to disable the mouse pointer for the content.

    .av-masonry-entry {
    	cursor: initial;
    }
    
    .av-masonry-outerimage-container, .av-masonry-entry-title {
    	cursor: pointer;
    }
    

    and I think it is not seo friendly because it will see the link in the text and this is create confusing for crawler.

    Please note that the whole masonry item is a link or is wrapped inside an anchor tag. You have to modify the shortcode or template directly if you want to adjust the default markup of the masonry element. Unfortunately, this is beyond the scope of support.

    If you have any additional questions at this time we kindly ask that you open them up in a separate thread. The longer threads get in the forum, they become more difficult to support as they tend to drift off topic and they also make it troublesome for users trying to search for solutions. Keeping threads relevant to their original inquiry ensures that we can keep better track of what has been resolved and that users can more effectively find answers to similar issues they might be experiencing.

    Thanks!

    Best regards,
    Ismael

    #1242543
    This reply has been marked as private.
    #1242734

    Hi,

    The code is located in enfold\config-templatebuilder\avia-shortcodes\av-helper-masonry.php.

    Check function html().

    Hope this will help you.

    Best regards,
    Günter

    #1243910
    This reply has been marked as private.
    #1244081

    Hi ChrisCoach,

    Great :)

    We are closing the thread.

    If you need further assistance please let us know in a new one.

    Best regards,
    Victoria

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Masonry anchor title’ is closed to new replies.