Instagram for WordPress
inserting shortcode into a post to work like the widget (3 posts)

  1. 0kem
    Posted 4 years ago #


    I want to know the shortcode to make this plugin work exactly like the widget....

    I want to insert this into a post and have the fade displaying different images for a specific hashtag.

    When i use the shortcode in the description;

    ([instagram url='http://instagr.am/p/BSJRn/' size='large' addlink='no'])

    it only displays one specific static image. Does anybody know how to alter this code to display all images from #example hashtag and fade into one and other.

    Hope thats clear enough. (2:30am here and im basically sleep typing)

    Any help would be appreciated


  2. the world
    Posted 3 years ago #

    I have the same issue. There is only 1 static image that shows up all the time. No other url works. Has anyone found a solution to this yet?

    To be more specific:

    I am using something like this: - which is not working
    <?php echo do_shortcode('[instagram url="http://instagram.com/p/ZGWAFkP3n4/" size="medium" addlink="no"]'); ?>

    Only the line of code given on the plugin page works:
    [instagram url='http://instagr.am/p/BSJRn/' size='large' addlink='no']

    Why is it that one url works and not any other?

    Any suggestion welcome.


  3. the world
    Posted 3 years ago #


    The issue was with the regular expression matching in the plugin file

    In the plugin file instagram-for-wordpress/wpinstagram.php the function
    function instagram_embed_shortcode was checking for a regular expression instagr.am which meant that any url which is something like instagram.com was not validated. So I changed that to

    if(($url != '')&&((preg_match('/^http:\/\/instagram\.com\/p\/[a-zA-Z0-9-_]+\/$/', $url))||(preg_match('/^http:\/\/instagr\.am\/p\/[a-zA-Z0-9-_]+\/$/', $url)))):

    It works fine now.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Instagram for WordPress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.