-
AuthorPosts
-
January 21, 2021 at 9:12 pm #1274528
Hi, I’ve set masonry gallery and need image titles to be shown below photos, however I obviously do not want titles to be seen after mouse hovering.
I’ve found dozen of forum topics with answers “put some code into functions.php with official Krisi documentation. I’ve tried like zillion solutions and still those titles are seen.
I will appreciate any help because I wasted like 3 hours for that, half a day is out and it is still not done.
Webpage is http://www.centrumnautica.pl, masony gallery of 5 photos in the middle of the mail page.
Thank you!!!January 22, 2021 at 6:41 am #1274629Hey EWAKOPI,
Can you try adding this code in your child theme’s functions.php (at the bottom):
function remove_title(){ ?> <script> (function () { jQuery(document).ready(function ($) { $('#top .isotope-item').removeAttr('title'); $('#top .isotope-item .av-masonry-image-container').removeAttr('title'); }); })(); </script> <?php } add_action('wp_footer', 'remove_title');
Best regards,
NikkoJanuary 22, 2021 at 10:52 am #1274652I am not using child’s theme, \i will check that though in a sec.
January 22, 2021 at 10:57 am #1274653I’ve updated functions.php in enfold child, unfortunately I still see those filenames.
https://www.centrumnautica.plJanuary 22, 2021 at 3:17 pm #1274759Hi EWAKOPI,
Please post us your login credentials (in the “private data” field), so we can take a look at your backend.
- Install and activate ” Temporary Login Without Password “.
- Go to ” Users > Temporary Logins ” on the left-side menu.
- Click ” Create New “.
- Add the email address for the account ( you can use (Email address hidden if logged out) ), as well as the ” Role ” making that the highest possible and the expiry about four days
( to be sure that we have enough time to debug ). - Click ” Submit “.
- You’ll now have a temporary account. Please provide us here in the private section the URL, so we can login and help you out.
When your issue is fixed, you can always remove the plugin!
If you prefer to not use the plugin, you can manually create an admin user and post the login credentials in the “private data” field.Best regards,
NikkoJanuary 22, 2021 at 3:40 pm #1274770Ok, you will find login data enclosed. Thank you!
January 23, 2021 at 10:33 am #1274933Hi EWAKOPI,
Thanks, the reason why it’s not working is because the child theme needs to be activated.
However, when I tried to activate the child theme and import the parent settings, some parts of the site are not correct so I have to activate back the parent theme.
Then I installed and activated this plugin: Insert Headers and Footers, then in the for the Scripts in Footer I put this code:<script> (function () { function removeTitle(el) { el.removeAttribute('title'); } const items = document.querySelectorAll('#top .isotope-item'); const containers = document.querySelectorAll('#top .isotope-item .av-masonry-image-container'); items.forEach(removeTitle); containers.forEach(removeTitle); })(); </script>
Please review your site.
Best regards,
NikkoJanuary 24, 2021 at 3:08 pm #1275071Thanks, now it’s ok! It’s a shame you had to use additional plugin though, was hoping you can make it in functions.php correct so I would know what was the problem with my changes. Most importantly – it’s now ok, thanks again!
January 25, 2021 at 4:18 am #1275165Hi EWAKOPI,
Yes, that’s true but since I have to consider that it’s a live site, I opted into using a plugin instead of a child theme.
Also, there were no issues in functions.php it’s only that it’s not working because the code was in the child theme’s functions.php and it’s the parent theme (enfold) that has the code.
With WordPress, when a child theme is activated it inherits the code from the parent, but if the parent theme is activated, it’s only the parent theme’s functions that will run.Best regards,
NikkoJanuary 25, 2021 at 10:22 am #1275204Sure, I get it. This is why I always edit main functions.php – is it wrong then? Why should I be using Child theme in the first place?
January 26, 2021 at 5:01 am #1275368 -
AuthorPosts
- You must be logged in to reply to this topic.