Skip to content

Commit

Permalink
Merge pull request #68 from jdmdigital/development
Browse files Browse the repository at this point in the history
v1.2
  • Loading branch information
jdmdigital committed Apr 8, 2016
2 parents c6d19a5 + bd6f028 commit 2efb513
Show file tree
Hide file tree
Showing 18 changed files with 305 additions and 371 deletions.
7 changes: 5 additions & 2 deletions archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
?>
<ul class="list-unstyled author-info post-meta">
<?php if($curauth->ID != '') : ?> <li><span class="bp-rss margin-right"></span> <b><?php echo count_user_posts($curauth->ID); ?></b> Posts</li> <?php endif; ?>
<?php if($curauth->user_url != '') : ?> <li><span class="bp-link margin-right"></span> <a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a></li> <?php endif; ?>
<?php if($curauth->user_description != '') : ?> <li><span class="bp-heart margin-right"></span> <b>Bio:</b> <?php echo $curauth->user_description; ?></li> <?php endif; ?>
<?php if($curauth->user_url != '') : ?> <li><span class="bp-link margin-right"></span> <a href="<?php echo $curauth->user_url; ?>" target="_blank" rel="nofollow"><?php echo $curauth->user_url; ?></a></li> <?php endif; ?>
<?php if(get_the_author_meta('twitter')) : ?> <li><span class="bp-twitter margin-right"></span> <a href="https://twitter.com/<?php the_author_meta('twitter') ?>" target="_blank" rel="nofollow">@<?php the_author_meta('twitter') ?></a></li> <?php endif; ?>
<?php if(get_the_author_meta('googleplus')) : ?><li><span class="bp-gplus margin-right"></span> <a href="<?php the_author_meta('googleplus') ?>" target="_blank" rel="nofollow"><?php the_author_meta('googleplus') ?></a></li> <?php endif; ?>
<?php if(get_the_author_meta('facebook')) : ?> <li><span class="bp-facebook margin-right"></span> <a href="<?php the_author_meta('facebook') ?>" target="_blank" rel="nofollow"><?php the_author_meta('facebook') ?></a></li> <?php endif; ?>
<?php if($curauth->user_description != '') : ?> <li><span class="bp-heart margin-right"></span> <b>Bio:</b> <?php echo $curauth->user_description; ?></li> <?php endif; ?>
</ul>
<?php else : ?>
<?php the_archive_description( '<p>', '</p>' ); ?>
Expand Down
5 changes: 4 additions & 1 deletion content.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<article class="post-content col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2 <?php echo get_post_format(); ?>">
<?php the_featured_image(); ?>
<?php the_content(); ?>
<div class="row margint-top">

<?php echo get_bootplate_share(); ?>

<div class="row margin-top">
<div class="col-lg-12">
<ul class="pager">
<li class="pager-prev"><?php previous_post_link ( '%link', __('Previous Article', 'bootplate'), $in_same_term = true, '', $taxonomy = 'category' ); ?></li>
Expand Down
7 changes: 7 additions & 0 deletions css/body.min.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions css/parent.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ img.border{border:1px solid #222;}
.jumbotron-fluid { padding-right: 0; padding-left: 0; border-radius: 0;}
.jumbotron h1{color:#fff;}
.jumbotron .lead{font-size:1.2rem;}
.jumbotron .btn{margin-bottom:15px;}
.jumbotron .btn{margin-bottom: 30px;}
.center-block{display: block; margin-left: auto; margin-right: auto;}
.invisible{visibility: hidden;}
.navbar.navbar-full{border-radius:0;margin-bottom:0;}
.hidden-xs-up{display:none;}
.jumbotron .jumboscroll{position:absolute; bottom:30px; left:0; right:0; margin: 0 auto;}
p, ul, ol{margin-bottom:30px;}
p, ul, ol, .embed-responsive{margin-bottom:30px;}
h1, .h1, h2, .h2, h3, .h3{margin-top:30px;}
abbr{border-bottom: 1px dotted #888;cursor: help; text-decoration:none;}
.btn-circle {display: table-cell; vertical-align: middle; text-align: center; border-radius:50%; height:80px; width:80px; font-size:12px; text-wrap:normal;}
Expand Down Expand Up @@ -317,7 +317,7 @@ article h4, article .h4{font-size:24px;}
.archive .sidebar-right{display:block;}
.sidebar-left{display:block;}
.the-excerpt{min-height:220px;}
article.post{min-height: 460px;}
article.post{min-height: 480px;}
}

/* == Narrow Height Viewport Styles == */
Expand Down
7 changes: 7 additions & 0 deletions css/parent.min.css

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,5 @@

<?php wp_footer(); ?>

<!--ANALYTICS HERE-->

</body>
</html>
126 changes: 84 additions & 42 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.1 Main Functions
* Bootplate v1.2 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.1);
define('VERSION', 1.2);
define("REPO", 'https://github.com/jdmdigital/bootplate');
define("BRANCH", '');

Expand Down Expand Up @@ -191,7 +191,7 @@ function bootplate_widgets_init() {
* Enqueue scripts and styles.
*/
function bootplate_scripts() {
wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', array(), '3.3.5' );
wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', array(), null, 'all' );

// See Issue 49 - https://github.com/jdmdigital/bootplate/issues/49
$child_style = get_stylesheet();
Expand All @@ -201,53 +201,70 @@ function bootplate_scripts() {
$has_child_style = true;
}

if( get_theme_mod( 'minify_bootplate_css', 'unmin-bootplate-css' ) == 'min-bootplate-css') {$mincss = true;} else { $mincss = false; }
if( get_theme_mod( 'minify_bootplate_js', 'unmin-bootplate-js' ) == 'min-bootplate-js') {$minjs = true;} else { $minjs = false; }

if(is_child_theme() && $has_child_style) {
// Load Parent.css instead of the full style.css file (or the minified version).
if(file_exists(get_template_directory_uri() . '/css/parent.min.css')) {
wp_enqueue_style( 'bootplate', get_template_directory_uri() . '/css/parent.min.css', array('bootstrap'), '' );
if($mincss) {
wp_enqueue_style( 'bootplate', get_template_directory_uri() . '/css/parent.min.css', array('bootstrap'), null );
} else {
wp_enqueue_style( 'bootplate', get_template_directory_uri() . '/css/parent.css', array('bootstrap'), '' );
wp_enqueue_style( 'bootplate', get_template_directory_uri() . '/css/parent.css', array('bootstrap'), null );
}
if(file_exists(get_stylesheet_directory_uri() . '/style.min.css')) {
wp_enqueue_style( $child_style, get_stylesheet_directory_uri() . '/style.min.css', array('bootstrap'), '' );
if($mincss) {
wp_enqueue_style( $child_style, get_stylesheet_directory_uri() . '/style.min.css', array('bootstrap'), null );
} else {
wp_enqueue_style( $child_style, get_stylesheet_directory_uri(). '/style.css', array('bootstrap'), '' );
wp_enqueue_style( $child_style, get_stylesheet_directory_uri(). '/style.css', array('bootstrap'), null );
}
} else {
// Using Parent Theme. Load full style.css (or the minified version).
if(file_exists(get_template_directory_uri() . '/style.min.css')) {
wp_enqueue_style( 'bootplate', get_template_directory_uri() . '/style.min.css', array('bootstrap'), '' );
if($mincss) {
wp_enqueue_style( 'bootplate', get_template_directory_uri() . '/style.min.css', array('bootstrap'), null );
} else {
wp_enqueue_style( 'bootplate', get_stylesheet_uri(), array('bootstrap'), '' );
wp_enqueue_style( 'bootplate', get_stylesheet_uri(), array('bootstrap'), null );
}
}

// Load the IE-specific stylesheet.
wp_enqueue_style( 'bootplate-ie', get_template_directory_uri() . '/css/ie.css', array( 'bootplate' ), '' );
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' );

if(function_exists('jdmfab_show_admin_buttons')) {
wp_deregister_script( 'jdm-fab' );
}

wp_deregister_script( 'html5shiv-maxcdn' );
wp_register_script( 'html5shiv-maxcdn', '//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js', '', '', false );
wp_register_script( 'html5shiv-maxcdn', '//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js', '', null, false );
wp_enqueue_script( 'html5shiv-maxcdn' );
wp_script_add_data( 'html5shiv-maxcdn', 'conditional', 'lt IE 9' );

wp_deregister_script( 'respond-js' );
wp_register_script( 'respond-js', '//oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js', '', '', false );
wp_register_script( 'respond-js', '//oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js', '', null, false );
wp_enqueue_script( 'respond-js' );
wp_script_add_data( 'respond-js', 'conditional', 'lt IE 9' );

wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', '', '', true );
wp_enqueue_script( 'jquery' );
if( get_theme_mod( 'cdn_jquery', 'jquery_cdn' ) == 'jquery_cdn') {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js', '', null, true );
wp_enqueue_script( 'jquery' );

if(function_exists('wpcf7_plugin_path')) {
wp_deregister_script( 'jquery-form' );
wp_register_script( 'jquery-form', '//cdnjs.cloudflare.com/ajax/libs/jquery.form/3.51/jquery.form.min.js', array('jquery'), null, true );
wp_enqueue_script( 'jquery-form' );
}
}

wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), null, true );
wp_enqueue_script( 'modernizr', get_template_directory_uri() . '/js/modernizr-custom.js', array('jquery'), null, true );

wp_enqueue_script( 'bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '', true );
wp_enqueue_script( 'modernizr', get_template_directory_uri() . '/js/modernizr-custom.js', array('jquery'), '', true );
wp_enqueue_script( 'bootplate-plugins', get_template_directory_uri() . '/js/plugins.js', array('jquery', 'modernizr'), '', true );
wp_enqueue_script( 'bootplate-main', get_template_directory_uri() . '/js/main.js', array('jquery', 'modernizr', 'bootplate-plugins'), bootplate_info('version'), 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 );
} 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 );
}

if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
Expand All @@ -258,11 +275,22 @@ function bootplate_scripts() {
// Get rid of bloated styles
function bootplate_deregister_styles() {
wp_deregister_style( 'contact-form-7' );
wp_deregister_style('shorty');
wp_deregister_style('jdm-fab');
}
add_action( 'wp_print_styles', 'bootplate_deregister_styles', 100 );

if(!function_exists('bootplate_remove_ver_css_js')) {
function bootplate_remove_ver_css_js( $src ) {
if ( strpos( $src, 'ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
}
if( get_theme_mod( 'enable_browser_cache', 'no_browser_cache' ) == 'browser_cache') {
add_filter( 'style_loader_src', 'bootplate_remove_ver_css_js', 9999 );
add_filter( 'script_loader_src', 'bootplate_remove_ver_css_js', 9999 );
}

// Remove oEmbed Gist Action
global $oe_gist;
remove_action( 'wp_head', array( $oe_gist, 'wp_head' ), 100 );
Expand All @@ -275,16 +303,13 @@ function bootplate_deregister_styles() {
function bootplate_async_css() {
$tempdir = get_template_directory_uri();

if(file_exists($tempdir.'/css/body.min.css')) {
$bodycss = 'body.min.css';
} else {
$bodycss = 'body.css';
}
if(get_theme_mod( 'minify_bootplate_css', 'unmin-bootplate-css' ) == 'min-bootplate-css') {$bodycss = 'body.min.css';} else {$bodycss = 'body.css';}
if(get_theme_mod( 'minify_bootplate_js', 'unmin-bootplate-js' ) == 'min-bootplate-js') {$loadcss = 'loadcss.min.js';} else {$loadcss = 'loadcss.js';}

echo '
<link rel="preload" href="'.$tempdir.'/css/'.$bodycss.'" as="style" onload="this.rel=\'stylesheet\'" type="text/css" />
<noscript><link rel="stylesheet" href="'.$tempdir.'/css/'.$bodycss.'" type="text/css" /></noscript>
<script src="'.$tempdir.'/js/loadcss.js" type="text/javascript"></script>
<script src="'.$tempdir.'/js/'.$loadcss.'" type="text/javascript"></script>
';
}
}
Expand Down Expand Up @@ -921,21 +946,16 @@ function bootplate_result_type() {
require get_template_directory() . '/inc/customizer.php';
require get_template_directory() . '/inc/custom_subtitles.php';

// add a favicon to front-end head
/*function site_favicons() {
echo '
<link rel="Shortcut Icon" type="image/x-icon" href="'.get_template_directory_uri().'/img/favicon.ico" />
';
}
add_action('wp_head', 'site_favicons');*/

// add a different favicon for the admin site
/*function admin_favicon() {
echo '
<!-- favicons here-->
';
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>';
return $return;
}
add_filter( 'embed_oembed_html', 'bootplate_oembed_filter', 90, 4 ) ;
add_filter( 'video_embed_html', 'bootplate_remove_wp_admin_links' ); // Jetpack
}
add_action('admin_head', 'admin_favicons');*/


// Remove WP Links in Admin
if(!function_exists('bootplate_remove_wp_admin_links')){
Expand All @@ -949,6 +969,7 @@ function bootplate_remove_wp_admin_links() {
//$wp_admin_bar->remove_menu('view-site');
}
add_action( 'wp_before_admin_bar_render', 'bootplate_remove_wp_admin_links' );

}

// Remove WP Icon from Admin Bar
Expand Down Expand Up @@ -1139,6 +1160,27 @@ function bootplate_get_logo(){
}
}

if(!function_exists('get_bootplate_share')) {
function get_bootplate_share() {
if(get_theme_mod( 'bootplate_enable_social_share', '') == 1) {
$url = get_permalink() ;
$text = get_the_title();
if(get_the_author_meta('twitter')) {$twitterhandle = '&via='.htmlentities(get_the_author_meta('twitter'));} else {$twitterhandle = '';}

$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="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="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
}
}

remove_action('wp_head', 'wp_generator');


Loading

0 comments on commit 2efb513

Please sign in to comment.