Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Scott (@scottsweb)

    (@scottsweb)

    It can be done. It is probably best to create a custom template part as documented in the FAQs, under hooks and filters:

    In version 1.4 and above you can also customise the image loop completely by creating a parts/wp-instagram-widget.php file in your theme.

    You can create your own output for the plugin with this file and customise it completely. Start by copying this line:

    https://github.com/scottsweb/wp-instagram-widget/blob/master/wp-instagram-widget.php#L108

    into the file and adjust accordingly. You would need to remove the img title attribute.

    Thread Starter Carrie Koehmstedt

    (@koehmstedt)

    When I do that it breaks the widget output… I copied that line of code into the file:

    echo '<li class="' . esc_attr( $liclass ) . '"><a href="' . esc_url( $item['link'] ) . '" target="' . esc_attr( $target ) . '" class="' . esc_attr( $aclass ) . '"><img src="' . esc_url( $item[$size] ) . '" alt="' . esc_attr( $item['description'] ) . '" title="' . esc_attr( $item['description'] ) . '" class="' . esc_attr( $imgclass ) . '"/></a></li>';

    And removed the title attribute so it now looks like this:

    echo '<li class="' . esc_attr( $liclass ) . '"><a href="' . esc_url( $item['link'] ) . '" target="' . esc_attr( $target ) . '" class="' . esc_attr( $aclass ) . '"><img src="' . esc_url( $item[$size] ) . '" alt="' . esc_attr( $item['description'] ) . '" class="' . esc_attr( $imgclass ) . '"/></a></li>';

    Am I missing something? Because I see this code, instead of instagram images, in the widget area on the site:

    echo '' . esc_attr( $item['description'] ) . ''; echo '' . esc_attr( $item['description'] ) . ''; echo '' . esc_attr( $item['description'] ) . ''; echo '' . esc_attr( $item['description'] ) . ''; echo '' . esc_attr( $item['description'] ) . ''; echo '' . esc_attr( $item['description'] ) . '';

    Plugin Author Scott (@scottsweb)

    (@scottsweb)

    Can you explain a bit more about the process you followed to add the code to your theme. The code you have provided in the second example looks about right but the output is way off which makes me think it has been added incorrectly.

    Carrie, did you add the php open tag <?php at the top of your part file?

    Thread Starter Carrie Koehmstedt

    (@koehmstedt)

    @arneb No, I did not.

    I guess adding that would solve the issue.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to hide img title when hovering’ is closed to new replies.