Skip to content

Instantly share code, notes, and snippets.

@hostz-frank
Created December 10, 2015 11:53
Show Gist options
  • Save hostz-frank/96740079db54eead16d6 to your computer and use it in GitHub Desktop.
Save hostz-frank/96740079db54eead16d6 to your computer and use it in GitHub Desktop.
Full width stream of Instagram posts on a WordPress frontpage
<?php
// Into front-page.php; exact location depends on the theme, e.g. just before sth. like:
// <div id="sidebar-footer" class="footer-widget-area clearfix" role="complementary">
if ( is_active_sidebar( 'instagrid_full_width' ) ) : ?>
<div id="instagrid" class="site-content">
<?php dynamic_sidebar( 'instagrid_full_width' ); ?>
</div><!-- #instagrid -->
<?php endif; ?>
<?php
// Register custom widget area for Instagram.
// Could reside inside e.g. functions.php of a child theme or in a custom plugin.
function theme_add_my_instagrid() {
$args = array(
'id' => 'instagrid_full_width',
'name' => 'Instagram Feed Container',
'description' => 'Container for the Instagram-Widget.',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
);
register_sidebar( $args );
}
add_action( 'widgets_init', 'theme_add_my_instagrid' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment