Docs    Instagram    Customizations

How to change the color of the icons when a photo has a like or comment

By default the like and comment icons for each photo will remain the same color whether they are 0 or not. You can add a JavaScript snippet to the plugin which will change the color of the icons when a photo has received either a like or comment. Add the following to the plugin’s Custom JavaScript section, which is on the plugin’s Customize page and tweak the colors in the snippet accordingly:

$('#sb_instagram .sbi_item').each(function(){
  $self = $(this);
  if( parseInt( $self.find('.sbi_likes').text() ) > 0 ) $self.find('.sbi_likes, .sbi_likes svg').css('color', 'blue');
  if( parseInt( $self.find('.sbi_comments').text() ) > 0 ) $self.find('.sbi_comments, .sbi_comments svg').css('color', 'blue');
});

Technical Support

Still have questions? We are here to help you succeed.

Open a support ticket