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

    Hello Support

    I have two questions about the Masonry Gallery:

    Is there a possibility to make the whole image block (which is already) + text block underneath sensitive, either by a function or by a tweak in the theme?

    Thanks to your forum, I found a function that crops all the content to a certain number of characters but for reasons I haven’t found yet, the PHP+js code is only supported when the user is logged in, which is far from practical and democratic :)

    Thanks for your answers
    Sincerely

    Regards

    #1336299

    Hey Ikyo,

    Thank you for the inquiry.

    Would you mind posting the code that you are currently using? Did you use the is_admin conditional function?

    (which is already) + text block underneath sensitive

    What do you mean by “sensitive”? Please provide a screenshot using imgur or dropbox.

    Best regards,
    Ismael

    #1336361

    Sorry…I was wrong ; I’m talking about “POST SLIDER” and not Masonry

    Thank you very much for your quick response. Herewith some more explanations (because my first draft was not very comprehensible).

    1 – The codes I use in the functions.php file of the child theme are the following (there may be a bis repetita). The following image shows that the code is visible when connected, and not effective when not connected

    2 – In PJ we see images of what would want for the clickable area : in fact, I will need, the image, the title (actually clickable) AND the text to be clickable and link to the concerned url.

    I thank you once again
    Kind regards

    #1336464

    Hi,

    Thank you for the screenshots.

    Would you mind posting the login details in the private field? We would like to check the code in the functions.php file and modify it if necessary.

    To make the whole post entry clickable, try to add this script in the functions.php file.

    function ava_custom_script() { ?>
        <script>
            (function($) {
                $(".slide-entry").on("click", function(e) {
                e.preventDefault();
                var link = $(this).find(".slide-image").href();
                
                window.location.href = link;
                });
            })(jQuery);
    	</script>
        <?php
    }
    add_action('wp_footer', 'ava_custom_script');
    

    Best regards,
    Ismael

    #1336502

    Thank you very much for this code
    I integrated it on functions.php, but unfortunately it doesn’t seem to work, even when adapting the CSS classes that are called.

    I wish you a very nice day

    #1336508

    Hi,

    Thank you for the access.

    We adjusted the code in the functions.php file a bit.

    
    function ava_custom_script() { ?>
        <script>
            (function($) {
                $(".slide-entry").on("click", function(e) {
    				e.preventDefault();
    				var link = $(this).find(".slide-image").attr("href");
    				window.location.href = link;
                });
            })(jQuery);
    	</script>
        <?php
    }
    add_action('wp_footer', 'ava_custom_script');

    You may need to add this css code to adjust the mouse cursor to pointer when hovering the articles.

    .slide-entry {
    	cursor: pointer;
    }
    

    Best regards,
    Ismael

    #1336512

    Ah…fantastic it works perfectly
    But there must be a damn is_admin() function lying around somewhere because these features only work once you are logged in.
    Do you know why?

    I thank you very much
    Regards

    #1336760

    Hi,
    Thank you for your patience, you had an error because you had the option Enfold Theme Options ▸ Performance ▸ Load jQuery in your footer set, I disabled this setting and now the script works correctly.
    Please clear your browser cache and check.

    Best regards,
    Mike

    #1336852

    Hello Mike

    Don’t thank me for my patience…it’s only natural. I would like to thank you very much for your 5 star support. Everything is indeed solved
    I wish you a great week

    #1336864

    Hi,

    Great, I’m glad that Mike could help you out. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

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