Skip to content

Commit

Permalink
Merge pull request #75 from jdmdigital/development
Browse files Browse the repository at this point in the history
Pull Version 1.3
  • Loading branch information
jdmdigital committed Apr 12, 2016
2 parents 2efb513 + 5c05d57 commit 8c2dfda
Show file tree
Hide file tree
Showing 19 changed files with 385 additions and 300 deletions.
8 changes: 8 additions & 0 deletions css/body.css
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,12 @@ footer a:hover, footer a:focus, footer a:active{color:#fff;}
#bootplate-credit{margin-top:3rem;}
.no-cssremunit #bootplate-credit{margin-top:40px;}
#bootplate-credit p{color:rgba(255,255,255,0.3);}
a.back-to-top{display:none; position:fixed; border: 4px solid #666; bottom: 30px; opacity: 0.4; right: 30px; height:55px; width:55px; border-radius:4px;-webkit-transition: all 250ms ease; -moz-transition: all 250ms ease;-ms-transition: all 250ms ease;-o-transition: all 250ms ease;transition: all 250ms ease;}
a.back-to-top:hover, a.back-to-top:focus{opacity:0.9; cursor:pointer; text-decoration:none;}
a.back-to-top.lighter{opacity: 0.7;-webkit-transition: all 250ms ease; -moz-transition: all 250ms ease;-ms-transition: all 250ms ease;-o-transition: all 250ms ease;transition: all 250ms ease;}
a.back-to-top span {color: #666; font-size: 1.4em; padding:4px 8px; position: absolute; text-align: center; top:1px; right:3px; text-decoration:none;}
a.back-to-top span:hover, a.back-to-top span:focus{text-decoration:none;}
a.back-to-top span:before{display:inline-block; line-height:1; top:1px; margin-left:0; margin-right:0;}

/* JDM FAB Styles */
#fab-admin-btns{width:170px; position:fixed; top:60px; right:0; opacity:0.8;-webkit-transition: all 300ms ease; -moz-transition: all 300ms ease;-ms-transition: all 300ms ease;-o-transition: all 300ms ease;transition: all 300ms ease;}
Expand Down Expand Up @@ -434,6 +440,8 @@ footer a:hover, footer a:focus, footer a:active{color:#fff;}

/* == Medium Devices, Desktops == */
@media only screen and (min-width : 992px) {
body .bootplate-card{min-height:100px}
body .bootplate-card .card-text{min-height:128px}
/* Slick Arrows */
.slick-prev,.slick-next{ font-size: 0; line-height: 0; position: absolute; top: 50%; display: block; width: 30px; height: 30px; margin-top: -15px; padding: 0; cursor: pointer; color: transparent; border: none; outline: none; background: transparent;}
.slick-prev:hover,.slick-prev:focus,.slick-next:hover,.slick-next:focus{ color: transparent; outline: none; background: transparent;}
Expand Down
4 changes: 2 additions & 2 deletions css/body.min.css

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion css/parent.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Bootplate Parent CSS is just the basics
This (simplified) stylesheet is only loaded when a child theme is in use.
v1.1
v1.3
*/

@-webkit-viewport { width: device-width; }
Expand Down Expand Up @@ -174,13 +174,22 @@ h4.widget-title a{color:#444; font-size: 1em;}
.widget_recent_entries ul, .widget_rss ul{list-style:none; padding-left:0;}
.widget_rss ul{opacity:1; transition:opacity 0.3s ease-in;}
.widget_rss ul a, .widget_rss span, .widget_rss cite{display:block;}
.widget_categories ul, .widget_archive ul{list-style:none; padding-left:0;}
footer{opacity:0; background-color:#000; }
footer small{font-size:0.6em;}
article h4, article .h4{font-size:24px;}
.gallery-columns-2 .gallery-item, .gallery-columns-3 .gallery-item, .gallery-columns-4 .gallery-item{width:100%; float:none;}
.gallery-item img{width:100%; height:auto;}
.gallery-item .gallery-caption{margin-bottom:0; padding:4px 8px; background-color:#eee; border-bottom:1px solid #ddd; font-size:0.8em;}
.btn.btn-disabled{cursor:not-allowed; opacity:0.8; color:rgba(255,255,255,0.7);}

a.back-to-top{display:none; position:fixed; border: 4px solid #666; bottom: 30px; opacity: 0.4; right: 30px; height:55px; width:55px; border-radius:4px;-webkit-transition: all 250ms ease; -moz-transition: all 250ms ease;-ms-transition: all 250ms ease;-o-transition: all 250ms ease;transition: all 250ms ease;}
a.back-to-top:hover, a.back-to-top:focus{opacity:0.9; cursor:pointer; text-decoration:none;}
a.back-to-top.lighter{opacity: 0.7;-webkit-transition: all 250ms ease; -moz-transition: all 250ms ease;-ms-transition: all 250ms ease;-o-transition: all 250ms ease;transition: all 250ms ease;}
a.back-to-top span {color: #666; font-size: 1.4em; padding:4px 8px; position: absolute; text-align: center; top:1px; right:3px; text-decoration:none;}
a.back-to-top span:hover, a.back-to-top span:focus{text-decoration:none;}
a.back-to-top span:before{display:inline-block; line-height:1; top:1px; margin-left:0; margin-right:0;}

/* == Custom, Mobile-First Media Queries == */
/* Remember:
Min-Width: Refers to everything greater than or equal to the amount given.
Expand Down
6 changes: 3 additions & 3 deletions css/parent.min.css

Large diffs are not rendered by default.

110 changes: 65 additions & 45 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* ///
* (o 0)
* ======o00o-(_)-o00o======
* Bootplate v1.2 Main Functions
* Bootplate v1.3 Main Functions
* @link https://github.com/jdmdigital/bootplate
* Made with love by @jdmdigital
* =========================
Expand All @@ -22,7 +22,7 @@
* GNU General Public License for more details.
*/

define('VERSION', 1.2);
define('VERSION', 1.3);
define("REPO", 'https://github.com/jdmdigital/bootplate');
define("BRANCH", '');

Expand All @@ -47,6 +47,8 @@ function bootplate_info($data = 'version') {
} else {
return $repo;
}
} elseif ($data == 'stringver') {
return sprintf('%1', $version);
} else {
return $version;
}
Expand Down Expand Up @@ -207,24 +209,27 @@ function bootplate_scripts() {
if(is_child_theme() && $has_child_style) {
// Load Parent.css instead of the full style.css file (or the minified version).
if($mincss) {
wp_enqueue_style( 'bootplate', get_template_directory_uri() . '/css/parent.min.css', array('bootstrap'), null );
wp_enqueue_style( 'bootplate', get_template_directory_uri() . '/css/parent.min.css', array('bootstrap'), bootplate_resource_version() );
} else {
wp_enqueue_style( 'bootplate', get_template_directory_uri() . '/css/parent.css', array('bootstrap'), null );
wp_enqueue_style( 'bootplate', get_template_directory_uri() . '/css/parent.css', array('bootstrap'), bootplate_resource_version() );
}
if($mincss) {
wp_enqueue_style( $child_style, get_stylesheet_directory_uri() . '/style.min.css', array('bootstrap'), null );
wp_enqueue_style( $child_style, get_stylesheet_directory_uri() . '/style.min.css', array( 'bootstrap' ), bootplate_resource_version() );
} else {
wp_enqueue_style( $child_style, get_stylesheet_directory_uri(). '/style.css', array('bootstrap'), null );
wp_enqueue_style( $child_style, get_stylesheet_directory_uri() . '/style.css', array( 'bootstrap' ), bootplate_resource_version() );
}
} else {
// Using Parent Theme. Load full style.css (or the minified version).
if($mincss) {
wp_enqueue_style( 'bootplate', get_template_directory_uri() . '/style.min.css', array('bootstrap'), null );
wp_enqueue_style( 'bootplate', get_template_directory_uri() . '/style.min.css', array('bootstrap'), bootplate_resource_version() );
} else {
wp_enqueue_style( 'bootplate', get_stylesheet_uri(), array('bootstrap'), null );
wp_enqueue_style( 'bootplate', get_stylesheet_uri(), array('bootstrap'), bootplate_resource_version() );
}

}



// Load the IE-specific stylesheet.
wp_enqueue_style( 'bootplate-ie', get_template_directory_uri() . '/css/ie.css', array( 'bootplate' ), null );
wp_style_add_data( 'bootplate-ie', 'conditional', 'lt IE 9' );
Expand Down Expand Up @@ -259,11 +264,11 @@ function bootplate_scripts() {
wp_enqueue_script( 'modernizr', get_template_directory_uri() . '/js/modernizr-custom.js', array('jquery'), null, true );

if($minjs) {
wp_enqueue_script( 'bootplate-plugins', get_template_directory_uri() . '/js/plugins.min.js', array('jquery', 'modernizr'), null, true );
wp_enqueue_script( 'bootplate-main', get_template_directory_uri() . '/js/main.min.js', array('jquery', 'modernizr', 'bootplate-plugins'), null, true );
wp_enqueue_script( 'bootplate-plugins', get_template_directory_uri() . '/js/plugins.min.js', array('jquery', 'modernizr'), bootplate_resource_version(), true );
wp_enqueue_script( 'bootplate-main', get_template_directory_uri() . '/js/main.min.js', array('jquery', 'modernizr', 'bootplate-plugins'), bootplate_resource_version(), true );
} else {
wp_enqueue_script( 'bootplate-plugins', get_template_directory_uri() . '/js/plugins.js', array('jquery', 'modernizr'), null, true );
wp_enqueue_script( 'bootplate-main', get_template_directory_uri() . '/js/main.js', array('jquery', 'modernizr', 'bootplate-plugins'), null, true );
wp_enqueue_script( 'bootplate-plugins', get_template_directory_uri() . '/js/plugins.js', array('jquery', 'modernizr'), bootplate_resource_version(), true );
wp_enqueue_script( 'bootplate-main', get_template_directory_uri() . '/js/main.js', array('jquery', 'modernizr', 'bootplate-plugins'), bootplate_resource_version(), true );
}

if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
Expand All @@ -279,6 +284,8 @@ function bootplate_deregister_styles() {
}
add_action( 'wp_print_styles', 'bootplate_deregister_styles', 100 );


// Remove Version Query String
if(!function_exists('bootplate_remove_ver_css_js')) {
function bootplate_remove_ver_css_js( $src ) {
if ( strpos( $src, 'ver=' ) )
Expand All @@ -291,6 +298,17 @@ function bootplate_remove_ver_css_js( $src ) {
add_filter( 'script_loader_src', 'bootplate_remove_ver_css_js', 9999 );
}

if(!function_exists('bootplate_resource_version')) {
function bootplate_resource_version() {
if( get_theme_mod( 'enable_browser_cache', 'no_browser_cache' ) == 'browser_cache') {
return null;
} else {
//return bootplate_info('stringver');
return '1.3';
}
}
}

// Remove oEmbed Gist Action
global $oe_gist;
remove_action( 'wp_head', array( $oe_gist, 'wp_head' ), 100 );
Expand Down Expand Up @@ -436,24 +454,41 @@ function bootplate_amp_css( $amp_template ) {
}

// Nicer Search - Creates a specific /search/ page instead of index.php?s=, which confuses google.
if(!function_exists('bootplate_nice_search_redirect')) {
if(!function_exists('bootplate_nice_search_redirect') && !function_exists('bootplate_change_ssb_search')) {
function bootplate_nice_search_redirect() {
global $wp_rewrite;
if ( !isset( $wp_rewrite ) || !is_object( $wp_rewrite ) || !$wp_rewrite->using_permalinks() )
return;

$search_base = $wp_rewrite->search_base;
if ( is_search() && !is_admin() && strpos( $_SERVER['REQUEST_URI'], "/{$search_base}/" ) === false ) {
wp_redirect( home_url( "/{$search_base}/" . urlencode( get_query_var( 's' ) ) ) );
exit();
}
}

// For Yoast SEO URL Fix: https://github.com/jdmdigital/bootplate/issues/31
// The returned string must always include {search_term} to indicate where the search term should be used.
// @returns string new searchURL
function bootplate_change_ssb_search() {
global $wp_rewrite;
if ( !isset( $wp_rewrite ) || !is_object( $wp_rewrite ) || !$wp_rewrite->using_permalinks() )
return;
$search_base = $wp_rewrite->search_base;
return home_url("/{$search_base}/").'{search_term}';
//return 'http://mysite.com/?search={search_term}';
}

// Add_Action ONLY if the Enable Search is = 1
if(get_theme_mod( 'bootplate_enable_search', '') == 1) {
if(function_exists('wpseo_init')) {
// For Yoast SEO URL Fix: https://github.com/jdmdigital/bootplate/issues/31
add_filter('wpseo_json_ld_search_url', 'bootplate_change_ssb_search' );
}
add_action( 'template_redirect', 'bootplate_nice_search_redirect' );
}
}


if ( ! function_exists( 'bootplate_comment_nav' ) ) :
/**
* Display navigation to next/previous comments when applicable.
Expand Down Expand Up @@ -727,29 +762,6 @@ function bootplate_paginate_links( $args = '' ) {
} // end bootplate_paginate_links()
}// end if !exists

/**
* Yoast Breadcrumbs on Twitter Bootstrap v3.3 - BROKEN
*
* @author Justin Downey
* @license MIT License
* @param string $sep Your custom separator
*/
/*function downey_bootplate_breadcrumbs($sep = '|') {
if (!function_exists('yoast_breadcrumb')) {
return null;
}
$old_sep = '\&raquo\;';
$breadcrumbs = yoast_breadcrumb( '<ol class="breadcrumb"><li>', '</li></ol>', false );
if(strpos($breadcrumbs, $old_sep) !== false) {
$output = str_replace( $old_sep, '</li><li>', $breadcrumbs );
} else {
$output = str_replace( $sep, '</li><li>', $breadcrumbs );
}
return $output;
} */

// Echo Breadcrumbs if Yoast SEO is installed
if(!function_exists('bootplate_breadcrumbs') ) {
function bootplate_breadcrumbs() {
Expand Down Expand Up @@ -842,7 +854,7 @@ function have_bootplate_btns() {
/* Featured Image Functions
* @since v0.6
*/

// Adds classes to <header>, usage: <header class="<php echo header_classes() endPHP >
// Will add .has-featured-image to header if there's a featured image set.
if(!function_exists('header_classes')) {
Expand Down Expand Up @@ -939,14 +951,11 @@ function bootplate_result_type() {
}
}

//require get_template_directory() . '/inc/customizer.php';

//require get_template_directory() . '/inc/shortcodes.php';

require get_template_directory() . '/inc/customizer.php';
require get_template_directory() . '/inc/custom_subtitles.php';


// Wraps oembed videos in Bootstrap responsive embed class
if(!function_exists('bootplate_oembed_filter')) {
function bootplate_oembed_filter($html, $url, $attr, $post_ID) {
$return = '<div class="embed-responsive embed-responsive-16by9">'.$html.'</div>';
Expand Down Expand Up @@ -1009,6 +1018,16 @@ function bootplate_no_wp_howdy( $wp_admin_bar ) {
add_action( 'admin_bar_menu', 'bootplate_no_wp_howdy', 11 );
}

// @since v1.3
if(get_theme_mod( 'bootplate_enable_totop', '') == 1) {
if(!function_exists('bootplate_totop_link')) {
function bootplate_totop_link() {
echo '<a id="pageup" class="back-to-top"><span class="bp-up-open glyphicon glyphicon-chevron-up"></span></a>';
}
add_action( 'wp_footer', 'bootplate_totop_link', 6 );
}
}

/**
* Disable the emoji's
* Note: Emoticons will still work and emoji's will still work in browsers which have built in support for them.
Expand Down Expand Up @@ -1169,15 +1188,16 @@ function get_bootplate_share() {

$html = '<div class="social-share margin-top">'."\r\n";
$html .= ' <div class="btn-group btn-group-justified" role="group" aria-label="Share this post">'."\r\n";
$html .= ' <a class="mini btn btn-default btn-secondary" href="https://twitter.com/share?text='.htmlentities($text).'&url='.urlencode($url).htmlentities($twitterhandle).'" title="Twitter" role="button"><span class="bp-twitter"></span></a>'."\r\n";
$html .= ' <a class="mini btn btn-default btn-secondary" href="https://twitter.com/share?text='.urlencode(html_entity_decode($text, ENT_COMPAT, 'UTF-8')).'&url='.urlencode($url).htmlentities($twitterhandle).'" title="Twitter" role="button"><span class="bp-twitter"></span></a>'."\r\n";
$html .= ' <a class="mini btn btn-default btn-secondary" href="http://www.facebook.com/share.php?u='.$url.'" title="Facebook" role="button"><span class="bp-facebook"></span></a>'."\r\n";
$html .= ' <a class="mini btn btn-default btn-secondary" href="http://www.linkedin.com/shareArticle?mini=true&url='.urlencode($url).'&title='.htmlentities($text).'" title="LinkedIn" role="button"><span class="bp-linkedin"></span></a>'."\r\n";
$html .= ' <a class="mini btn btn-default btn-secondary" href="http://www.linkedin.com/shareArticle?mini=true&url='.urlencode($url).'&title='.urlencode(html_entity_decode($text, ENT_COMPAT, 'UTF-8')).'" title="LinkedIn" role="button"><span class="bp-linkedin"></span></a>'."\r\n";
$html .= ' <a class="mini btn btn-default btn-secondary" href="https://plus.google.com/share?url='.urlencode($url).'" title="Google Plus" role="button"><span class="bp-gplus"></span></a>'."\r\n";
$html .= ' </div>'."\r\n";
$html .= '</div>'."\r\n";

return $html;
} // Does nothing if not enabled in customizer
} // Returns nothing if not enabled in customizer (they might be using something else)
return '';
}
}

Expand Down
19 changes: 19 additions & 0 deletions inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,25 @@ function bootplate_customize_register( $wp_customize ) {
)
);

// Add Bootplate Back-to-Top Enable
$wp_customize->add_setting(
'bootplate_enable_totop',
array(
'sanitize_callback' => 'bootplate_sanitize_checkbox',
)
);

// Add Bootplate Back-to-Top Enable Control
$wp_customize->add_control(
'bootplate_enable_totop',
array(
'label' => 'Enable Back-to-Top',
'description' => 'Show a back-to-top link after 500px scrolled?',
'section' => 'general_settings_section',
'type' => 'checkbox',
)
);

// Add Bootplate Search Icon Enable
$wp_customize->add_setting(
'bootplate_enable_search',
Expand Down
12 changes: 9 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
<?php
/*
* The main template file
* Update @v1.3
*/

get_header(); ?>

<?php if ( have_posts() ) : ?>

<?php while ( have_posts() ) : the_post() ; ?>
<header class="<?php echo header_classes(); ?>">
<div class="container">
<?php the_title( '<h1>', '</h1>' ); ?>
<?php
if(get_option('page_for_posts')) {
$blog_page_id = get_option('page_for_posts');
echo '<h1>'.get_page($blog_page_id)->post_title.'</h1>';
} else {
the_title( '<h1>', '</h1>' );
} ?>
<?php if(have_bootplate_subtitle()) { bootplate_subtitle(); } ?>
</div><!--/.container-->
</header>
Expand All @@ -21,7 +27,7 @@
</div>
</div>
</section>
<?php endwhile; ?>


<?php else : ?>

Expand Down
Loading

0 comments on commit 8c2dfda

Please sign in to comment.