Skip to content

Commit 0d2dcd9

Browse files
Merge pull request #109 from MachoThemes/master
Enhancements round #3
2 parents d40cdc5 + d1291f7 commit 0d2dcd9

File tree

5 files changed

+106
-45
lines changed

5 files changed

+106
-45
lines changed

footer.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
</div><!-- #main -->
1616
</section><!-- section -->
1717

18-
<?php shapely_footer_callout(); ?>
19-
18+
<div class="footer-callout">
19+
<?php shapely_footer_callout(); ?>
20+
</div>
2021
<footer id="colophon" class="site-footer footer bg-dark" role="contentinfo">
2122
<div class="container footer-inner">
2223
<div class="row">

header.php

Lines changed: 45 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,60 +4,65 @@
44
*
55
* This is the template that displays all of the <head> section and everything up until <div id="content">
66
*
7-
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
7+
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
88
*
99
* @package Shapely
1010
*/
1111

1212
?><!DOCTYPE html>
1313
<html <?php language_attributes(); ?>>
1414
<head>
15-
<meta charset="<?php bloginfo( 'charset' ); ?>">
16-
<meta name="viewport" content="width=device-width, initial-scale=1">
17-
<link rel="profile" href="http://gmpg.org/xfn/11">
18-
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
15+
<meta charset="<?php bloginfo( 'charset' ); ?>">
16+
<meta name="viewport" content="width=device-width, initial-scale=1">
17+
<link rel="profile" href="http://gmpg.org/xfn/11">
18+
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
1919

20-
<?php wp_head(); ?>
20+
<?php wp_head(); ?>
2121
</head>
2222

2323
<body <?php body_class(); ?>>
2424
<div id="page" class="site">
2525
<a class="skip-link screen-reader-text" href="#content"><?php esc_html_e( 'Skip to content', 'shapely' ); ?></a>
2626

2727
<header id="masthead" class="site-header" role="banner">
28-
<div class="nav-container">
29-
<nav id="site-navigation" class="main-navigation" role="navigation">
30-
<div class="container nav-bar">
31-
<div class="row">
32-
<div class="module left site-title-container">
33-
<?php shapely_get_header_logo(); ?>
34-
</div>
35-
<div class="module widget-handle mobile-toggle right visible-sm visible-xs">
36-
<i class="fa fa-bars"></i>
37-
</div>
38-
<div class="module-group right">
39-
<div class="module left">
40-
<?php shapely_header_menu(); // main navigation ?>
41-
</div>
42-
<!--end of menu module-->
43-
<div class="module widget-handle search-widget-handle left hidden-xs hidden-sm">
44-
<div class="search">
45-
<i class="fa fa-search"></i>
46-
<span class="title"><?php _e("Site Search", 'shapely'); ?></span>
47-
</div>
48-
<div class="function"><?php
49-
get_search_form(); ?>
50-
</div>
51-
</div>
52-
</div>
53-
<!--end of module group-->
54-
</div>
55-
</div>
56-
</nav><!-- #site-navigation -->
57-
</div>
28+
<div class="nav-container">
29+
<nav id="site-navigation" class="main-navigation" role="navigation">
30+
<div class="container nav-bar">
31+
<div class="row">
32+
<div class="module left site-title-container">
33+
<?php shapely_get_header_logo(); ?>
34+
</div>
35+
<div class="module widget-handle mobile-toggle right visible-sm visible-xs">
36+
<i class="fa fa-bars"></i>
37+
</div>
38+
<div class="module-group right">
39+
<div class="module left">
40+
<?php shapely_header_menu(); // main navigation ?>
41+
</div>
42+
<!--end of menu module-->
43+
<div class="module widget-handle search-widget-handle left hidden-xs hidden-sm">
44+
<div class="search">
45+
<i class="fa fa-search"></i>
46+
<span class="title"><?php _e( "Site Search", 'shapely' ); ?></span>
47+
</div>
48+
<div class="function"><?php
49+
get_search_form(); ?>
50+
</div>
51+
</div>
52+
</div>
53+
<!--end of module group-->
54+
</div>
55+
</div>
56+
</nav><!-- #site-navigation -->
57+
</div>
5858
</header><!-- #masthead -->
5959
<div id="content" class="main-container">
60-
<?php ( is_page_template('template-home.php') ) ? '' : shapely_top_callout(); ?>
61-
<section class="content-area <?php echo ( get_theme_mod('top_callout', true ) ) ? '' : ' pt0 ' ?>">
62-
<div id="main" class="<?php echo ( !is_page_template( 'template-home.php' )) ? 'container': ''; ?>" role="main">
63-
<div class="row">
60+
<?php if ( ! is_page_template( 'template-home.php' ) ): ?>
61+
<div class="header-callout">
62+
<?php shapely_top_callout(); ?>
63+
</div>
64+
<?php endif; ?>
65+
<section class="content-area <?php echo ( get_theme_mod( 'top_callout', true ) ) ? '' : ' pt0 ' ?>">
66+
<div id="main" class="<?php echo ( ! is_page_template( 'template-home.php' ) ) ? 'container' : ''; ?>"
67+
role="main">
68+
<div class="row">

inc/customizer.php

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,51 @@ function shapely_customize_register( $wp_customize ) {
1212
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
1313
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
1414
$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';
15+
$wp_customize->get_setting( 'custom_logo' )->transport = 'refresh';
16+
17+
// Abort if selective refresh is not available.
18+
if ( ! isset( $wp_customize->selective_refresh ) ) {
19+
return;
20+
}
21+
22+
$wp_customize->selective_refresh->add_partial( 'blogname', array(
23+
'selector' => '.site-title',
24+
'render_callback' => function () {
25+
bloginfo( 'name' );
26+
},
27+
) );
28+
29+
$wp_customize->selective_refresh->add_partial( 'footer_callout_text', array(
30+
'selector' => '.footer-callout',
31+
'render_callback' => function () {
32+
shapely_footer_callout();
33+
}
34+
) );
35+
$wp_customize->selective_refresh->add_partial( 'footer_callout_btntext', array(
36+
'selector' => '.footer-callout',
37+
'render_callback' => function () {
38+
shapely_footer_callout();
39+
}
40+
) );
41+
$wp_customize->selective_refresh->add_partial( 'footer_callout_link', array(
42+
'selector' => '.footer-callout',
43+
'render_callback' => function () {
44+
shapely_footer_callout();
45+
}
46+
) );
47+
$wp_customize->selective_refresh->add_partial( 'blog_name', array(
48+
'selector' => '.header-callout',
49+
'render_callback' => function () {
50+
shapely_top_callout();
51+
}
52+
) );
53+
$wp_customize->selective_refresh->add_partial( 'header_textcolor', array(
54+
'selector' => '.header-callout',
55+
'render_callback' => function () {
56+
shapely_top_callout();
57+
}
58+
) );
59+
1560
}
1661

1762
add_action( 'customize_register', 'shapely_customize_register' );
@@ -131,7 +176,7 @@ function shapely_customizer( $wp_customize ) {
131176
}
132177

133178
$wp_customize->add_setting( 'hide_post_title', array(
134-
'default' => 1,
179+
'default' => 0,
135180
'sanitize_callback' => 'shapely_sanitize_checkbox',
136181
) );
137182

@@ -157,6 +202,7 @@ function shapely_customizer( $wp_customize ) {
157202
$wp_customize->add_setting( 'blog_name', array(
158203
'default' => '',
159204
'sanitize_callback' => 'shapely_sanitize_strip_slashes',
205+
'transport' => 'postMessage'
160206
) );
161207
$wp_customize->add_control( 'blog_name', array(
162208
'label' => __( 'Blog Name in top callout', 'shapely' ),
@@ -188,6 +234,7 @@ function shapely_customizer( $wp_customize ) {
188234
$wp_customize->add_setting( 'footer_callout_text', array(
189235
'default' => '',
190236
'sanitize_callback' => 'shapely_sanitize_strip_slashes',
237+
'transport' => 'postMessage'
191238
) );
192239
$wp_customize->add_control( 'footer_callout_text', array(
193240
'label' => __( 'Text for footer callout', 'shapely' ),
@@ -198,6 +245,7 @@ function shapely_customizer( $wp_customize ) {
198245
$wp_customize->add_setting( 'footer_callout_btntext', array(
199246
'default' => '',
200247
'sanitize_callback' => 'shapely_sanitize_strip_slashes',
248+
'transport' => 'postMessage'
201249
) );
202250
$wp_customize->add_control( 'footer_callout_btntext', array(
203251
'label' => __( 'Text for footer callout button', 'shapely' ),
@@ -206,6 +254,7 @@ function shapely_customizer( $wp_customize ) {
206254
$wp_customize->add_setting( 'footer_callout_link', array(
207255
'default' => '',
208256
'sanitize_callback' => 'esc_url_raw',
257+
'transport' => 'postMessage'
209258
) );
210259
$wp_customize->add_control( 'footer_callout_link', array(
211260
'label' => __( 'CFA button link', 'shapely' ),

inc/extras.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,11 +540,12 @@ function shapely_top_callout() {
540540
$breadcrumbs_enabled = ( $options['breadcrumbs-enable'] === true );
541541
$title_in_post = get_theme_mod( 'hide_post_title', false );
542542
}
543+
$header_color = get_theme_mod( 'header_textcolor', false );
543544
?>
544545
<?php if ( $title_in_post ): ?>
545546
<div
546547
class="<?php echo $breadcrumbs_enabled ? 'col-md-6 col-sm-6 col-xs-12' : 'col-xs-12'; ?>">
547-
<h3 class="page-title">
548+
<h3 class="page-title" <?php echo $header_color ? 'style="color:#' . esc_attr( $header_color ) . '"' : '' ?>>
548549
<?php
549550
if ( is_home() ) {
550551
_e( ( get_theme_mod( 'blog_name' ) ) ? get_theme_mod( 'blog_name' ) : 'Blog', 'shapely' );

style.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1986,6 +1986,7 @@ input[type="submit"]:focus {
19861986
.pagination {
19871987
margin: 0;
19881988
border: none;
1989+
background: transparent;
19891990
}
19901991

19911992
.pagination .nav-links *:first-child {
@@ -3182,7 +3183,7 @@ footer.bg-dark a {
31823183
left: 0 !important;
31833184
}
31843185

3185-
#colophon .customize-partial-edit-shortcut button, #colophon .widget .customize-partial-edit-shortcut button, #secondary .customize-partial-edit-shortcut button, #secondary .widget .customize-partial-edit-shortcut button {
3186+
#site-navigation .customize-partial-edit-shortcut button, #site-navigation .widget .customize-partial-edit-shortcut button, #colophon .customize-partial-edit-shortcut button, #colophon .widget .customize-partial-edit-shortcut button, #secondary .customize-partial-edit-shortcut button, #secondary .widget .customize-partial-edit-shortcut button {
31863187
left: -30px !important;
31873188
}
31883189

@@ -3221,4 +3222,8 @@ footer.bg-dark a {
32213222
.shapely_home_parallax {
32223223
width: 100%;
32233224
display: inline-block;
3225+
}
3226+
3227+
.bg-secondary .text-right {
3228+
z-index: 2;
32243229
}

0 commit comments

Comments
 (0)