• Resolved refan

    (@refan)


    Hello,

    The widget for this so nicely. There is anyone to know how to showing caption with WP Instagram Widget?

    Thanks

Viewing 4 replies - 1 through 4 (of 4 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 like:

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

    into the file and adjust accordingly.

    Thread Starter refan

    (@refan)

    Hello Scott,

    I’m using Version: 2.0.2
    Can you give me little bit instruction, which one of the script in wp-instagram-widget.php to customize captions?

    Thanks

    Thread Starter refan

    (@refan)

    Hi Scott,

    I’m already add script below in wp-instagram-widget.php, my web got error 500. In captions not working. Why?

    add_filter(‘null_instagram_cache_time’, ‘my_cache_time’);

    function my_cache_time() {
    return HOUR_IN_SECONDS;
    }

    add_filter(‘wpiw_images_only’, ‘__return_true’);

    add_filter( ‘wpiw_list_class’, ‘my_instagram_class’ );

    add_filter( ‘wpiw_item_class’, ‘my_instagram_class’ );
    add_filter( ‘wpiw_a_class’, ‘my_instagram_class’ );
    add_filter( ‘wpiw_img_class’, ‘my_instagram_class’ );
    add_filter( ‘wpiw_linka_class’, ‘my_instagram_class’ );

    function my_instagram_class( $classes ) {
    $classes = “instagram-image”;
    return $classes;
    }

    Plugin Author Scott (@scottsweb)

    (@scottsweb)

    This is not what you need to do. As mentioned above you need to create a file in your theme in a folder called parts. The file should be called wp-instagram-widget.php and it should contain:

    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>';

    You can the customise this output to contain captions.

    I recommend hiring a developer if you need further help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to Showing Caption’ is closed to new replies.