Skip to content

Commit

Permalink
Merge branch 'release/1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Misplon committed Nov 28, 2017
2 parents 4d39c42 + 69573cf commit 8b0e38d
Show file tree
Hide file tree
Showing 21 changed files with 551 additions and 211 deletions.
9 changes: 9 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
== Changelog ==

= 1.1 - 28 November 2017 =
* Additional styling for the post format gallery slider.
* Updated image caption styling.
* Updated Calendar widget styling.
* Added a posts slider loop for use in the Page Builder Post Loop widget.
* Added posts slider support for Jetpack Featured Content.
* Added bottom bar social widget support.
* Added a header overlap page setting.

= 1.0 - 22 November 2017 =
* Added additional page settings.
* Added post format support for Gallery, Image, Video.
Expand Down
12 changes: 11 additions & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,17 @@
}
?>
</div><!-- .site-info -->
<?php wp_nav_menu( array( 'theme_location' => 'menu-2', 'container_class' => 'footer-menu', 'depth' => 1, 'fallback_cb' => '' ) ); ?>
<?php
$widget = siteorigin_setting( 'footer_social_widget' );
if ( has_nav_menu( 'menu-2' ) || ! empty( $widget['networks'] ) ) : ?>
<div class="footer-menu">
<?php wp_nav_menu( array( 'theme_location' => 'menu-2', 'depth' => 1, 'fallback_cb' => '' ) ); ?>
<?php if ( ! empty( $widget['networks'] ) && class_exists( 'SiteOrigin_Widget_SocialMediaButtons_Widget' ) ) {
the_widget( 'SiteOrigin_Widget_SocialMediaButtons_Widget', $widget );
}
?>
</div><!-- .footer-menu -->
<?php endif; ?>
</div><!-- .corp-container -->
</div><!-- .bottom-bar -->

Expand Down
2 changes: 1 addition & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function siteorigin_corp_scripts() {
// Flexslider.
wp_register_script( 'jquery-flexslider', get_template_directory_uri() . '/js/jquery.flexslider' . SITEORIGIN_THEME_JS_PREFIX . '.js', array( 'jquery' ), '2.6.3', true );

if ( is_single() && has_post_format( 'gallery' ) ) {
if ( is_home() && siteorigin_corp_has_featured_posts() ) {
wp_enqueue_script( 'jquery-flexslider' );
}

Expand Down
8 changes: 7 additions & 1 deletion inc/extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
*/
function siteorigin_corp_body_classes( $classes ) {

// Header margin.
if ( is_home() && siteorigin_corp_has_featured_posts() ) {
$classes[] = 'no-header-margin';
}

// Mobile compatibility classes.
$classes[] = 'css3-animations';
$classes[] = 'no-js';
Expand All @@ -31,9 +36,10 @@ function siteorigin_corp_body_classes( $classes ) {

if ( ! empty( $page_settings ) ) {
if ( ! empty( $page_settings['layout'] ) ) $classes[] = 'page-layout-' . $page_settings['layout'];
if ( ! empty( $page_settings['overlap'] ) && ( $page_settings['overlap'] != 'disabled' ) ) $classes[] = 'overlap-' . $page_settings['overlap'];
if ( empty( $page_settings['header_margin'] ) ) $classes[] = 'no-header-margin';
if ( empty( $page_settings['footer_margin'] ) ) $classes[] = 'no-footer-margin';
}
}

// Responsive layout.
$classes[] = 'responsive';
Expand Down
9 changes: 9 additions & 0 deletions inc/jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
* See: https://jetpack.me/support/responsive-videos/
*/
function siteorigin_corp_jetpack_setup() {
/*
* Enable support for Jetpack Featured Content.
* See https://jetpack.com/support/featured-content/
*/
add_theme_support( 'featured-content', array(
'filter' => 'siteorigin_corp_get_featured_posts',
'post_types' => array( 'post' ),
) );

/*
* Enable support for Jetpack Infinite Scroll.
* See https://jetpack.com/support/infinite-scroll/
Expand Down
72 changes: 51 additions & 21 deletions inc/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,14 @@ function siteorigin_corp_settings_init() {
'description' => esc_html__( 'Hide the SiteOrigin link in your footer.', 'siteorigin-corp' ),
'teaser' => true,
),
'social_widget' => array(
'type' => 'widget',
'widget_class' => 'SiteOrigin_Widget_SocialMediaButtons_Widget',
'bundle_widget' => 'social-media-buttons',
'plugin' => 'so-widgets-bundle',
'plugin_name' => esc_html__( 'SiteOrigin Widgets Bundle', 'siteorigin-corp' ),
'description' => esc_html__( 'Add social icons to bottom bar menu.', 'siteorigin-corp' ),
),
'widget_title' => array(
'type' => 'color',
'label' => esc_html__( 'Widget Title Color', 'siteorigin-corp' ),
Expand Down Expand Up @@ -447,7 +455,6 @@ function siteorigin_corp_font_settings( $settings ) {
function siteorigin_corp_settings_custom_css( $css ) {
// Custom CSS.
$css .= '/* style */
/**** /private/var/folders/_s/htpl50fd5d70c9hb2nnvjnjh0000gn/T/B6bssz/sass/style.css ***/
body,button,input,select,optgroup,textarea {
color: ${typography_text};
.font( ${typography_body_font} );
Expand Down Expand Up @@ -519,30 +526,32 @@ function siteorigin_corp_settings_custom_css( $css ) {
a:hover,a:focus,a:active {
color: ${typography_text};
}
.main-navigation ul ul li a {
background: ${navigation_drop_down_background};
border-color: ${navigation_drop_down_divider};
color: ${navigation_drop_down_link};
}
.main-navigation ul ul li:hover > a {
color: ${navigation_drop_down_link_hover};
}
.main-navigation ul ul li:first-of-type {
border-top: 2px solid ${navigation_link_accent};
}
.main-navigation ul ul a {
background: ${navigation_drop_down_background};
border-bottom: 1px solid ${navigation_drop_down_divider};
color: ${navigation_drop_down_link};
}
.main-navigation ul li {
.font( ${typography_heading_font} );
}
.main-navigation ul a {
border-bottom: 2px solid ${header_background};
.main-navigation ul li a {
color: ${navigation_link};
}
#site-navigation.main-navigation ul .menu-button a {
background: ${typography_accent};
}
#site-navigation.main-navigation ul .menu-button a:hover {
background: .rgba( ${typography_accent}, .8);
}
.main-navigation div > ul > li:hover > a {
border-color: ${navigation_link_accent};
}
.main-navigation div > ul > li.menu-item-has-children:hover > a,.main-navigation div > ul > li.page_item_has_children:hover > a {
border-color: ${header_background};
}
.main-navigation div > ul > li.current a,.main-navigation div > ul > li.current_page_item > a,.main-navigation div > ul > li.current-menu-item > a,.main-navigation div > ul > li.current_page_ancestor > a,.main-navigation div > ul > li.current-menu-ancestor > a {
border-color: ${navigation_link_accent};
}
Expand Down Expand Up @@ -635,22 +644,28 @@ function siteorigin_corp_settings_custom_css( $css ) {
.widget-area .widget a:hover,.site-footer .widget a:hover {
color: ${typography_accent};
}
.calendar_wrap {
border: 1px solid ${typography_border};
}
.widget #wp-calendar caption {
color: ${typography_heading};
}
.widget #wp-calendar thead {
border-bottom: 2px solid ${typography_border};
.widget #wp-calendar tbody td a {
color: ${typography_accent};
}
.widget #wp-calendar tbody td a:hover {
color: ${typography_text};
}
.widget #wp-calendar tfoot #prev a,.widget #wp-calendar tfoot #next a {
color: ${typography_heading};
}
.widget #wp-calendar tfoot #prev a:hover,.widget #wp-calendar tfoot #next a:hover {
color: ${typography_accent};
}
.widget_categories .cat-item {
.widget_archive li,.widget_categories li {
color: ${typography_secondary_text};
}
.widget_categories .cat-item a {
.widget_archive li a,.widget_categories li a {
color: ${typography_heading};
}
.widget_recent_comments .recentcomments {
Expand Down Expand Up @@ -874,6 +889,9 @@ function siteorigin_corp_settings_custom_css( $css ) {
.site-footer .bottom-bar a:hover {
color: ${footer_bottom_bar_link_hover};
}
.wp-caption {
color: ${typography_secondary_text};
}
.featured-posts-slider .slides .slide {
background-color: ${typography_text};
}';
Expand Down Expand Up @@ -1024,12 +1042,23 @@ function siteorigin_corp_page_settings( $settings, $type, $id ) {
),
);

$settings['overlap'] = array(
'type' => 'select',
'label' => esc_html__( 'Header Overlap', 'siteorigin-corp' ),
'options' => array(
'disabled' => esc_html__( 'Disabled', 'siteorigin-corp' ),
'enabled' => esc_html__( 'Enabled', 'siteorigin-corp' ),
'light' => esc_html__( 'Enabled - Light Text', 'siteorigin-corp' ),
'dark' => esc_html__( 'Enabled - Dark Text', 'siteorigin-corp' ),
),
);

$settings['header_margin'] = array(
'type' => 'checkbox',
'label' => esc_html__( 'Header Bottom Margin', 'siteorigin-corp' ),
'checkbox_label' => esc_html__( 'Enable', 'siteorigin-corp' ),
'description' => esc_html__( 'Display the margin below the header.', 'siteorigin-corp' )
);
);

$settings['page_title'] = array(
'type' => 'checkbox',
Expand Down Expand Up @@ -1060,11 +1089,12 @@ function siteorigin_corp_page_settings( $settings, $type, $id ) {
* Add the default Page Settings.
*/
function siteorigin_corp_setup_page_setting_defaults( $defaults, $type, $id ) {
$defaults['layout'] = 'default';
$defaults['header_margin'] = true;
$defaults['page_title'] = true;
$defaults['footer_margin'] = true;
$defaults['footer_widgets'] = true;
$defaults['layout'] = 'default';
$defaults['overlap'] = 'disabled';
$defaults['header_margin'] = true;
$defaults['page_title'] = true;
$defaults['footer_margin'] = true;
$defaults['footer_widgets'] = true;

return $defaults;
}
Expand Down
46 changes: 42 additions & 4 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ function siteorigin_corp_display_icon( $type ) {
<?php break;

case 'left-arrow' : ?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="21" height="28" viewBox="0 0 21 28">
<path d="M18.297 4.703l-8.297 8.297 8.297 8.297c0.391 0.391 0.391 1.016 0 1.406l-2.594 2.594c-0.391 0.391-1.016 0.391-1.406 0l-11.594-11.594c-0.391-0.391-0.391-1.016 0-1.406l11.594-11.594c0.391-0.391 1.016-0.391 1.406 0l2.594 2.594c0.391 0.391 0.391 1.016 0 1.406z"></path>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="18" height="32" viewBox="0 0 18 32">
<path fill="#fff" d="M18.284 29.705l-2.284 2.285-15.99-15.99 15.99-15.99 2.284 2.285-13.705 13.705z"></path>
</svg>
<?php break;

Expand All @@ -154,8 +154,8 @@ function siteorigin_corp_display_icon( $type ) {
<?php break;

case 'right-arrow' : ?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="19" height="28" viewBox="0 0 19 28">
<path d="M17.297 13.703l-11.594 11.594c-0.391 0.391-1.016 0.391-1.406 0l-2.594-2.594c-0.391-0.391-0.391-1.016 0-1.406l8.297-8.297-8.297-8.297c-0.391-0.391-0.391-1.016 0-1.406l2.594-2.594c0.391-0.391 1.016-0.391 1.406 0l11.594 11.594c0.391 0.391 0.391 1.016 0 1.406z"></path>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="18" height="32" viewBox="0 0 18 32">
<path fill="#fff" d="M17.589 16l-15.402 15.989-2.2-2.283 13.202-13.706-13.202-13.706 2.2-2.283 13.202 13.704z"></path>
</svg>
<?php break;

Expand Down Expand Up @@ -365,6 +365,44 @@ function siteorigin_corp_footer_text() {
}
endif;

/**
* Add a filter for Jetpack Featured Content.
*/
function siteorigin_corp_get_featured_posts() {
return apply_filters( 'siteorigin_corp_get_featured_posts', array() );
}

/**
* Check the Jetpack Featured Content.
*/
function siteorigin_corp_has_featured_posts( $minimum = 1 ) {
if ( is_paged() )
return false;

$minimum = absint( $minimum );
$featured_posts = apply_filters( 'siteorigin_corp_get_featured_posts', array() );

if ( ! is_array( $featured_posts ) )
return false;

if ( $minimum > count( $featured_posts ) )
return false;

return true;
}

if ( ! function_exists( 'siteorigin_corp_display_featured_posts' ) ) :
/**
* Output the Jetpack Featured Content.
*/
function siteorigin_corp_display_featured_posts() {
if ( is_home() && siteorigin_corp_has_featured_posts() ) {
get_template_part( 'template-parts/featured', 'slider' );
}
}
endif;
add_action( 'siteorigin_corp_content_before', 'siteorigin_corp_display_featured_posts' );

if ( ! function_exists( 'siteorigin_corp_strip_gallery' ) ) :
/**
* Remove gallery.
Expand Down
2 changes: 1 addition & 1 deletion loops/loop-blog.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Loop Name: Blog
* Loop Name: Blog Grid
*
* @package siteorigin-corp
* @license GPL 2.0
Expand Down
46 changes: 46 additions & 0 deletions loops/loop-slider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
* Loop Name: Posts Slider
*
* @package siteorigin-corp
* @license GPL 2.0
*/

wp_enqueue_script( 'jquery-flexslider' );

if ( have_posts() ) : ?>

<div class="flexslider featured-posts-slider">

<ul class="slides">

<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php $thumbnail = has_post_thumbnail() ? wp_get_attachment_url( get_post_thumbnail_id() ) : false; ?>

<li class="slide" <?php if ( ! empty( $thumbnail ) ) echo 'style="background-image: url( \'' . esc_url( $thumbnail ) . '\' )"'; ?>>
<div class="overlay"><a href="<?php the_permalink(); ?>"></a></div>
<div class="slide-content">
<div class="entry-meta">
<?php siteorigin_corp_post_meta(); ?>
</div><!-- .entry-meta -->
<?php the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); ?>
</div>
</li>

<?php endwhile; ?>

</ul>

<ul class="flex-direction-nav">
<li class="flex-nav-prev">
<a class="flex-prev" href="#"><?php siteorigin_corp_display_icon( 'left-arrow' ); ?></a>
</li>
<li class="flex-nav-next">
<a class="flex-next" href="#"><?php siteorigin_corp_display_icon( 'right-arrow' ); ?></a>
</li>
</ul>

</div><!-- .featured-posts-slider -->

<?php endif; ?>
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ A modern business theme from SiteOrigin. Corp is versatile and quick to customiz
SiteOrigin Corp includes support for the following plugins:

* [Breadcrumb NavXT](https://wordpress.org/plugins/breadcrumb-navxt/)
* [Jetpack Featured Content](https://jetpack.com/support/featured-content/)
* [Jetpack Infinite Scroll](https://jetpack.com/support/infinite-scroll/)
* [Jetpack Responsive Videos](https://jetpack.com/support/responsive-videos/)
* [Page Builder by SiteOrigin](https://wordpress.org/plugins/siteorigin-panels/)
Expand Down
7 changes: 4 additions & 3 deletions sass/media/_captions.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
.wp-caption {
font-size: 14px;
color: $color__text-light;
font-size: 13px;
max-width: 100%;

img[class*="wp-image-"] {
@include center-block;
}

.wp-caption-text {
margin: 12px 0;
margin: 14px 0;
}
}

.wp-caption-text {
text-align: center;
text-align: left;
}
Loading

0 comments on commit 8b0e38d

Please sign in to comment.