-
AuthorPosts
-
January 19, 2022 at 9:09 pm #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
SincerelyRegards
January 20, 2022 at 7:40 am #1336299Hey 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,
IsmaelJanuary 20, 2022 at 2:14 pm #1336361Sorry…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 regardsJanuary 21, 2022 at 6:40 am #1336464Hi,
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,
IsmaelJanuary 21, 2022 at 8:32 am #1336502Thank 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
January 21, 2022 at 10:12 am #1336508Hi,
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,
IsmaelJanuary 21, 2022 at 10:36 am #1336512Ah…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
RegardsJanuary 23, 2022 at 5:45 pm #1336760Hi,
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,
MikeJanuary 24, 2022 at 9:34 am #1336852Hello 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 weekJanuary 24, 2022 at 11:17 am #1336864 -
AuthorPosts
- You must be logged in to reply to this topic.