Created
December 10, 2015 11:53
-
-
Save hostz-frank/96740079db54eead16d6 to your computer and use it in GitHub Desktop.
Full width stream of Instagram posts on a WordPress frontpage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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