Skip to content

Instantly share code, notes, and snippets.

@cre8tivediva
Last active Jan 5, 2018
Embed
What would you like to do?
Add Custom Instragram Landing Page Similar to Linktree
//* Add Page Widget Area to Content - HTML5 only
add_action( 'genesis_entry_footer', 'custom_instagram_menu_add_page_content' );
function custom_instagram_menu_add_page_content() {
if ( is_page_template( 'instagram_landing.php' ) ) {
genesis_widget_area ('instagram-landing-page-widget', array(
'before' => '<div class="instagram-landing-page-widget"><div class="wrap">',
'after' => '</div></div>',
) );
}
}
//* Register Instagram Landing Page Widget Area
genesis_register_sidebar( array(
'id' => 'instagram-landing-page-widget',
'name' => __( 'Instagram Menu', 'themename' ),
'description' => __( 'This is the widget area for your custom Instagram Menu.', 'themename' ),
) );
/* # Custom Instagram Page for Menu Sharing on Instagram
---------------------------------------------------------------------------------------------------- */
.instagram-page .site-container {
/* background: #fff;*/
margin: 0 auto;
max-width: 800px;
}
.instagram-page .site-inner {
background: #fff none repeat scroll 0 0;
margin: 30px 25px;
padding: 25px;
}
.instagram-page p {
text-align: center;
}
.instagram-page .entry-title {
display: none;
}
.instagram-page .entry {
padding: 30px 0 !important;
}
.instagram-page .menu-item {
border: 1px solid #ae9d78;
margin-bottom: 20px;
padding: 5px 20px !important;
text-align: center;
text-decoration: none;
}
.instagram-page .menu-item a,
.instagram-page a {
border-bottom: 0;
text-decoration: none;
}
.instagram-page h3, .instagram-page .widget-title {
text-align: center;
}
.instagram-page .instagram-menu .widget ul > li:last-of-type {
padding: 5px 20px !important;
}
.instagram-page .user-profile .alignleft {
display: table;
float: none;
margin: 0 auto;
text-align: center;
}
.instagram-page .avatar {
border-radius: 100%;
float: none;
height: auto;
margin: 0 auto;
text-align: center;
}
.instagram-page .footer-widgets {
display: none;
}
.instagram-page .enews-widget {
background: #faf7f2 none repeat scroll 0 0;
padding: 20px;
text-align: center;
}
?php
/**
* Instagram Landing Page.
*
* This file adds the instagram landing page template to the your Genesis Child Theme based on the Genesis Sample.
*
* Template Name: Instagram Landing
*
* @package Genesis Child Theme
* @author StudioPress and modified by Anita C / Cre8tive Diva
* @license GPL-2.0+
* @link http://www.cre8tivediva.com/
*/
//* Add Instagram page body class to the head.
add_filter( 'body_class', 'custom_instagram_menu_add_body_class' );
function custom_instagram_menu_add_body_class( $classes ) {
$classes[] = 'instagram-page';
return $classes;
}
// Remove Skip Links.
remove_action ( 'genesis_before_header', 'genesis_skip_links', 5 );
// Dequeue Skip Links Script.
add_action( 'wp_enqueue_scripts', 'genesis_sample_dequeue_skip_links' );
function genesis_sample_dequeue_skip_links() {
wp_dequeue_script( 'skip-links' );
}
// Force full width content layout.
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' );
// Remove site header elements.
remove_action( 'genesis_header', 'genesis_header_markup_open', 5 );
remove_action( 'genesis_header', 'genesis_do_header' );
remove_action( 'genesis_header', 'genesis_header_markup_close', 15 );
// Remove navigation.
remove_theme_support( 'genesis-menus' );
// Remove breadcrumbs.
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
// Remove footer widgets.
remove_action( 'genesis_before_footer', 'genesis_footer_widget_areas' );
// Remove site footer elements.
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 );
// Run the Genesis loop.
genesis();
//* Add Instagram page body class to the head.
add_filter( 'body_class', 'custom_instagram_menu_add_body_class' );
function custom_instagram_menu_add_body_class( $classes ) {
$classes[] = 'instagram-page';
return $classes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment