Skip to content

Instantly share code, notes, and snippets.

@nciske
Forked from About2git/functions.php
Last active October 6, 2017 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nciske/1090ac00d5d059dee1731bc2508e1a86 to your computer and use it in GitHub Desktop.
Save nciske/1090ac00d5d059dee1731bc2508e1a86 to your computer and use it in GitHub Desktop.
Full width Soliloquy slider in Genesis
<?php
//* Do NOT include the opening php tag
//* This is optional if you don't want to use a widget for display (e.g. a shortcode or ACF will handle output)
//* Register Home Slider widget area
genesis_register_sidebar( array(
'id' => 'home-slider',
'name' => 'Home Slider',
'description' => 'This is the home slider section'
) );
add_action( 'genesis_after_header', 'sk_home_featured' );
/**
* Display Home Slider widget area's contents below Navigation on homepage.
*
* @author Sridhar Katakam
* @link http://sridharkatakam.com/full-width-soliloquy-slider-genesis/
*/
function sk_home_featured() {
if ( is_home() || is_front_page() ) {
genesis_widget_area( 'home-slider', array(
'before' => '<div class="home-slider widget-area">',
'after' => '</div>',
) );
}
}
/* Full width Soliloquy slider
------------------------------------- */
/* To get rid of -4px bottom margin for image links */
a img {
margin-bottom: 0;
}
/* To avoid noticeable vertical movement for hover state of Soliloquy's Control Nav (typically circles) */
.soliloquy-container .soliloquy-control-nav li a,
.soliloquy-theme-classic .soliloquy-pager-link {
-webkit-transition: none;
-moz-transition: none;
-ms-transition: none;
-o-transition: none;
transition: none;
}
/* To remove bottom border for Soliloquy controls */
.entry-content .soliloquy-controls-direction a, .entry-content a.soliloquy-pager-link {
border-bottom: none;
}
/* Drop the .home-slider prefix if not using a widget. */
.home-slider .soliloquy-container {
max-width: none !important;
max-height: 100% !important;
}
.home-slider .soliloquy-container .soliloquy-image {
width: 100% !important;
}
.home-slider .soliloquy-container .soliloquy-caption-inside {
padding: 30px;
}
.home-slider .soliloquy-container .slide-caption {
max-width: 960px;
margin: 0 auto;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment