Skip to content

Commit 4bd1fd3

Browse files
author
Cosmin
authored
Merge pull request #7 from c0sm1n87/master
see commits
2 parents 41bbfcd + 0915d13 commit 4bd1fd3

File tree

10 files changed

+121
-52
lines changed

10 files changed

+121
-52
lines changed

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
#30 - archive page did not implement layout styles
1717
#45 - added border-bottom checkbox toggle for widget
1818
#79 - added epsilon toggles for widgets
19+
#95 - changed import demo content to required action
20+
#103 - removed margin bottom from the widgets only in the main content
21+
#16 - added the first option
1922

2023
### 1.0.7
2124
<a href="https://github.com/puikinsh/shapely/issues">Issues</a>

functions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ function shapely_setup() {
9595

9696
add_image_size( 'shapely-featured', 848, 566, true );
9797

98+
add_theme_support( 'customize-selective-refresh-widgets' );
9899
// Welcome screen
99100
if ( is_admin() ) {
100101
global $shapely_required_actions, $shapely_recommended_plugins;
@@ -136,9 +137,8 @@ function shapely_setup() {
136137
array(
137138
"id" => 'shapely-req-import-content',
138139
"title" => esc_html__( 'Import content', 'shapely' ),
139-
"description" => esc_html__( 'Head over to the Demo Content tab (available only if you installed Shapely Companion plugin) and import sample content data.', 'shapely' ),
140-
"help" => '<a href="' . self_admin_url( 'themes.php?page=shapely-welcome&tab=demo_content' ) . '">' . __( 'Demo Content', 'shapely' ) . '</a>',
141-
"check" => Shapely_Notify_System::shapely_has_content(),
140+
"external" => ABSPATH . 'wp-content/plugins/shapely-companion/inc/views/shapely-demo-content.php',
141+
"check" => Shapely_Notify_System::shapely_check_import_req(),
142142
),
143143

144144
);

inc/admin/welcome-screen/css/welcome.css

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,21 @@
181181

182182
.about-wrap .three-col .plugin_box.col {
183183
width: 29.81%;
184-
}
184+
}
185+
186+
.shapely-media-control img {
187+
width: 100%;
188+
}
189+
190+
#demo_content .spinner {
191+
float: none;
192+
}
193+
194+
#demo_content .updated-message,
195+
#demo_content .spinner {
196+
display: none;
197+
}
198+
199+
#demo_content .spinner.is-active {
200+
display: inline-block;
201+
}

inc/admin/welcome-screen/notify-system-checks.php

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,32 @@ public static function shapely_is_not_static_page() {
2828
* @return bool
2929
*/
3030
public static function shapely_has_content() {
31-
$option = get_option( "shapely_show_required_actions" );
32-
if ( $option['shapely-req-import-content'] ) {
31+
$option = get_option( "shapely_imported_demo", false );
32+
if ( $option ) {
3333
return true;
3434
};
3535

3636
return false;
3737
}
3838

3939
/**
40-
* @return bool
40+
* @return bool|mixed
4141
*/
42-
public static function shapely_check_wordpress_importer() {
43-
if ( file_exists( ABSPATH . 'wp-content/plugins/wordpress-importer/wordpress-importer.php' ) ) {
44-
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
42+
public static function shapely_check_import_req() {
43+
$needs = array(
44+
'has_content' => self::shapely_has_content(),
45+
'has_plugin' => self::shapely_has_plugin( 'shapely-companion' )
46+
);
4547

46-
return is_plugin_active( 'wordpress-importer/wordpress-importer.php' );
48+
if ( $needs['has_content'] ) {
49+
return true;
4750
}
4851

49-
return false;
52+
if ( $needs['has_plugin'] ) {
53+
return false;
54+
}
55+
56+
return true;
5057
}
5158

5259
/**

inc/admin/welcome-screen/sections/actions-required.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,22 @@
2828
<div class="shapely-action-required-box">
2929
<?php if ( ! $hidden ): ?>
3030
<span data-action="dismiss" class="dashicons dashicons-visibility shapely-required-action-button"
31-
id="<?php echo $shapely_required_action_value['id']; ?>"></span>
31+
id="<?php echo esc_attr( $shapely_required_action_value['id'] ); ?>"></span>
3232
<?php else: ?>
33-
<span data-action="add" class="dashicons dashicons-hidden shapely-required-action-button" id="<?php echo $shapely_required_action_value['id']; ?>"></span>
33+
<span data-action="add" class="dashicons dashicons-hidden shapely-required-action-button"
34+
id="<?php echo esc_attr( $shapely_required_action_value['id'] ); ?>"></span>
3435
<?php endif; ?>
35-
<h3><?php if ( ! empty( $shapely_required_action_value['title'] ) ): echo $shapely_required_action_value['title']; endif; ?></h3>
36+
<h3><?php if ( ! empty( $shapely_required_action_value['title'] ) ): echo esc_html( $shapely_required_action_value['title'] ); endif; ?></h3>
3637
<p>
37-
<?php if ( ! empty( $shapely_required_action_value['description'] ) ): echo $shapely_required_action_value['description']; endif; ?>
38-
<?php if ( ! empty( $shapely_required_action_value['help'] ) ): echo '<br/>' . $shapely_required_action_value['help']; endif; ?>
38+
<?php if ( ! empty( $shapely_required_action_value['description'] ) ): echo esc_html( $shapely_required_action_value['description'] ); endif; ?>
39+
<?php if ( ! empty( $shapely_required_action_value['help'] ) ): echo '<br/>' . wp_kses_post( $shapely_required_action_value['help'] ); endif; ?>
3940
</p>
4041
<?php
42+
if ( ! empty( $shapely_required_action_value['external'] ) && file_exists( $shapely_required_action_value['external'] ) ) {
43+
require_once $shapely_required_action_value['external'];
44+
}
45+
?>
46+
<?php
4147
if ( ! empty( $shapely_required_action_value['plugin_slug'] ) ) {
4248
$active = $this->check_active( $shapely_required_action_value['plugin_slug'] );
4349
$url = $this->create_action_link( $active['needs'], $shapely_required_action_value['plugin_slug'] );
@@ -73,6 +79,7 @@ class="<?php echo $class; ?>"
7379
endforeach;
7480
endif;
7581

82+
7683
if ( $hooray ):
7784
echo '<span class="hooray">' . __( 'Hooray! There are no required actions for you right now.', 'shapely' ) . '</span>';
7885
endif;

inc/admin/welcome-screen/welcome-screen.php

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ public function check_for_icon( $arr ) {
266266
}
267267

268268
public function create_action_link( $state, $slug ) {
269+
$slug2 = $slug;
270+
if ( $slug === 'wordpress-seo' ) {
271+
$slug2 = 'wp-seo';
272+
}
269273
switch ( $state ) {
270274
case 'install':
271275
return wp_nonce_url(
@@ -282,19 +286,19 @@ public function create_action_link( $state, $slug ) {
282286
case 'deactivate':
283287
return add_query_arg( array(
284288
'action' => 'deactivate',
285-
'plugin' => rawurlencode( $slug . '/' . $slug . '.php' ),
289+
'plugin' => rawurlencode( $slug . '/' . $slug2 . '.php' ),
286290
'plugin_status' => 'all',
287291
'paged' => '1',
288-
'_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . $slug . '/' . $slug . '.php' ),
292+
'_wpnonce' => wp_create_nonce( 'deactivate-plugin_' . $slug . '/' . $slug2 . '.php' ),
289293
), network_admin_url( 'plugins.php' ) );
290294
break;
291295
case 'activate':
292296
return add_query_arg( array(
293297
'action' => 'activate',
294-
'plugin' => rawurlencode( $slug . '/' . $slug . '.php' ),
298+
'plugin' => rawurlencode( $slug . '/' . $slug2 . '.php' ),
295299
'plugin_status' => 'all',
296300
'paged' => '1',
297-
'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $slug . '/' . $slug . '.php' ),
301+
'_wpnonce' => wp_create_nonce( 'activate-plugin_' . $slug . '/' . $slug2 . '.php' ),
298302
), network_admin_url( 'plugins.php' ) );
299303
break;
300304
}
@@ -334,11 +338,6 @@ class="nav-tab <?php echo $active_tab == 'recommended_actions' ? 'nav-tab-active
334338
<?php echo $action_count > 0 ? '<span class="badge-action-count">' . esc_html( $action_count ) . '</span>' : '' ?></a>
335339
<a href="<?php echo admin_url( 'themes.php?page=shapely-welcome&tab=recommended_plugins' ); ?>"
336340
class="nav-tab <?php echo $active_tab == 'recommended_plugins' ? 'nav-tab-active' : ''; ?> "><?php echo esc_html__( 'Recommended Plugins', 'shapely' ); ?></a>
337-
<?php $shapely_companion = $this->check_active( 'shapely-companion' ); ?>
338-
<?php if ( $shapely_companion['needs'] === 'deactivate' ): ?>
339-
<a href="<?php echo admin_url( 'themes.php?page=shapely-welcome&tab=demo_content' ); ?>"
340-
class="nav-tab <?php echo $active_tab == 'demo_content' ? 'nav-tab-active' : ''; ?> "><?php echo esc_html__( 'Demo Content', 'shapely' ); ?></a>
341-
<?php endif; ?>
342341
<a href="<?php echo admin_url( 'themes.php?page=shapely-welcome&tab=support' ); ?>"
343342
class="nav-tab <?php echo $active_tab == 'support' ? 'nav-tab-active' : ''; ?> "><?php echo esc_html__( 'Support', 'shapely' ); ?></a>
344343
<a href="<?php echo admin_url( 'themes.php?page=shapely-welcome&tab=changelog' ); ?>"
@@ -362,12 +361,6 @@ class="nav-tab <?php echo $active_tab == 'changelog' ? 'nav-tab-active' : ''; ?>
362361
case 'changelog':
363362
require_once get_template_directory() . '/inc/admin/welcome-screen/sections/changelog.php';
364363
break;
365-
case 'demo_content':
366-
$shapely_companion = $this->check_active( 'shapely-companion' );
367-
if ( $shapely_companion['needs'] === 'deactivate' ) {
368-
require_once ABSPATH . 'wp-content/plugins/shapely-companion/inc/views/shapely-demo-content.php';
369-
}
370-
break;
371364
default:
372365
require_once get_template_directory() . '/inc/admin/welcome-screen/sections/getting-started.php';
373366
break;

inc/customizer.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,30 @@ function shapely_customizer( $wp_customize ) {
130130
) );
131131
}
132132

133+
$wp_customize->add_setting( 'hide_post_title', array(
134+
'default' => 1,
135+
'sanitize_callback' => 'shapely_sanitize_checkbox',
136+
) );
137+
138+
if(class_exists('Epsilon_Control_Toggle')){
139+
$wp_customize->add_control( new Epsilon_Control_Toggle(
140+
$wp_customize,
141+
'hide_post_title',
142+
array(
143+
'type' => 'mte-toggle',
144+
'label' => esc_html__( 'Title in blog post', 'shapely' ),
145+
'section' => 'wpseo_breadcrumbs_customizer_section',
146+
)
147+
)
148+
);
149+
} else {
150+
$wp_customize->add_control( 'hide_post_title', array(
151+
'label' => esc_html__( 'Title in blog post', 'shapely' ),
152+
'section' => 'wpseo_breadcrumbs_customizer_section',
153+
'type' => 'checkbox',
154+
) );
155+
}
156+
133157
$wp_customize->add_setting( 'blog_name', array(
134158
'default' => '',
135159
'sanitize_callback' => 'shapely_sanitize_strip_slashes',

inc/extras.php

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,8 @@ function shapely_get_header_logo() {
481481

482482
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php
483483
if ( $logo[0] != '' ) { ?>
484-
<img src="<?php echo esc_url($logo[0]); ?>" class="logo" alt="<?php echo esc_html( get_bloginfo( 'name' ) ); ?>"><?php
484+
<img src="<?php echo esc_url( $logo[0] ); ?>" class="logo"
485+
alt="<?php echo esc_html( get_bloginfo( 'name' ) ); ?>"><?php
485486
} else { ?>
486487
<span class="site-title"><?php echo esc_html( get_bloginfo( 'name' ) ); ?></span><?php
487488
} ?>
@@ -533,29 +534,34 @@ function shapely_top_callout() {
533534
<div class="row">
534535
<?php
535536
$breadcrumbs_enabled = false;
537+
$title_in_post = false;
536538
if ( function_exists( 'yoast_breadcrumb' ) ) {
537539
$options = get_option( 'wpseo_internallinks' );
538540
$breadcrumbs_enabled = ( $options['breadcrumbs-enable'] === true );
541+
$title_in_post = get_theme_mod( 'hide_post_title', false );
539542
}
540543
?>
541-
<div class="<?php echo $breadcrumbs_enabled ? 'col-md-6 col-sm-6 col-xs-12' : 'col-xs-12'; ?>">
542-
<h3 class="page-title">
543-
<?php
544-
if ( is_home() ) {
545-
_e( ( get_theme_mod( 'blog_name' ) ) ? get_theme_mod( 'blog_name' ) : 'Blog', 'shapely' );
546-
} else if ( is_search() ) {
547-
_e( 'Search', 'shapely' );
548-
} else if ( is_archive() ) {
549-
echo ( is_post_type_archive( 'jetpack-portfolio' ) ) ? __( 'Portfolio', 'shapely' ) : get_the_archive_title();
550-
} else {
551-
echo ( is_singular( 'jetpack-portfolio' ) ) ? __( 'Portfolio', 'shapely' ) : get_the_title();
552-
} ?>
553-
</h3>
554-
</div>
544+
<?php if ( $title_in_post ): ?>
545+
<div
546+
class="<?php echo $breadcrumbs_enabled ? 'col-md-6 col-sm-6 col-xs-12' : 'col-xs-12'; ?>">
547+
<h3 class="page-title">
548+
<?php
549+
if ( is_home() ) {
550+
_e( ( get_theme_mod( 'blog_name' ) ) ? get_theme_mod( 'blog_name' ) : 'Blog', 'shapely' );
551+
} else if ( is_search() ) {
552+
_e( 'Search', 'shapely' );
553+
} else if ( is_archive() ) {
554+
echo ( is_post_type_archive( 'jetpack-portfolio' ) ) ? __( 'Portfolio', 'shapely' ) : get_the_archive_title();
555+
} else {
556+
echo ( is_singular( 'jetpack-portfolio' ) ) ? __( 'Portfolio', 'shapely' ) : get_the_title();
557+
} ?>
558+
</h3>
559+
</div>
560+
<?php endif; ?>
555561
<?php if ( function_exists( 'yoast_breadcrumb' ) ) { ?>
556562
<?php
557563
if ( $breadcrumbs_enabled ) { ?>
558-
<div class="col-md-6 col-sm-6 col-xs-12 text-right">
564+
<div class="<?php echo $title_in_post ? 'col-md-6 col-sm-6' : ''; ?> col-xs-12 text-right">
559565
<?php yoast_breadcrumb( '<p id="breadcrumbs">', '</p>' ); ?>
560566
</div>
561567
<?php } ?>
@@ -612,7 +618,7 @@ function shapely_get_attachment_image() {
612618
$src = wp_get_attachment_image_src( $id, 'full', false );
613619

614620
if ( ! empty( $src[0] ) ) {
615-
echo esc_url($src[0]);
621+
echo esc_url( $src[0] );
616622
}
617623

618624
die();

readme.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*========= About Theme =========*/
22

33
Theme Name: Shapely
4-
Theme URI: http://colorlib.com/wp/shapely/
4+
Theme URI: https://colorlib.com/wp/shapely/
55
Version: 1.0.5
66
Tested up to: WP 4.6
77

88
Author: Aigars Silkalns
9-
Author URI: http://colorlib.com/wp/
9+
Author URI: https://colorlib.com/wp/
1010
License: GNU General Public License v3.0
1111
License URI: http://www.gnu.org/licenses/gpl.html
1212
-------------------------------------------------------

style.css

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Theme URI: https://colorlib.com/wp/themes/shapely
44
Author: colorlib
55
Author URI: https://colorlib.com/
66
Description: Shapely is a powerful and versatile one page WordPress theme with pixel perfect design and outstanding functionality. It is by far the most advanced free WordPress theme available today with loads of unmatched customization options. This theme comes with several homepage widgets that can be used to add portfolio, testimonials, parallax sections, your product or service information, call for action and much more. Shapely supports most free and premium WordPress plugins such as WooCommerce, Jetpack, Gravity Forms, Contact Form 7, Yoast SEO, Google Analytics by Yoast and much more. This theme is the best suited for business, landing page, portfolio, ecommerce, store, local business, personal websites but can be tweaked to be used as blog, magazine or any other awesome website while highlighting its unique one page setup. This is going to be the last WordPress theme you will ever want to use because it is so much better than anything you have seen. Needless to say that this theme is SEO friendly thanks to its well optimized strucutre. Shapely theme is mobile friendly and fully responsive making it your best multipurpose partnert for any project and website.
7-
Version: 1.0.7
7+
Version: 1.7.0
88
License: GNU General Public License v3
99
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1010
Text Domain: shapely
@@ -2050,6 +2050,10 @@ input[type="submit"]:focus {
20502050
}
20512051

20522052
.widget {
2053+
margin-bottom: 0;
2054+
}
2055+
2056+
#secondary .widget {
20532057
margin-bottom: 48px;
20542058
}
20552059

@@ -3163,4 +3167,12 @@ footer.bg-dark a {
31633167
.header-image-bg .page-title {
31643168
position: relative;
31653169
z-index: 2;
3170+
}
3171+
3172+
.customize-partial-edit-shortcut button, .widget .customize-partial-edit-shortcut button {
3173+
left: 0 !important;
3174+
}
3175+
3176+
#secondary .customize-partial-edit-shortcut button, #secondary .widget .customize-partial-edit-shortcut button {
3177+
left: -30px !important;
31663178
}

0 commit comments

Comments
 (0)