Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1291592

    Hello!
    I am setting up a new home page on an existing website. The site already uses portfolio grids extensively as news and project indexes. To differentiate news from projects, I have disabled the on-hover effect that would lay titles over grid items, and used a mixture of styled titles and excerpts to overlay text on images (fixed, not on-hover).

    For the new home page, I’m trying to restore some kind of rollover/hover effect for the items on the new page only. In the olden days, I would have done it with Javascript. Is there any other way I can get a hover text to appear for easysliders/blog-post-sliders and single images?

    Would it be possible, for example, to modify the on-hover-disabling code so that it was ignored for the new home page? The page ID is 13085. The disabling code (in functions.php) is …. (it came from https://kriesi.at/support/topic/hide-tooltips-on-gallery-images/)

    function add_custom_tooltip(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery(‘a’).removeAttr(‘title’);
    jQuery(‘img’).removeAttr(‘title’);
    });
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘add_custom_tooltip’);

    Many thanks

    Jane Joyce

    #1292065

    Hi Jane,

    If you want to load that script on a specific page only, then you can use the is_page function before the script: https://developer.wordpress.org/reference/functions/is_page/

    Best regards,
    Rikard

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