@@ -36,6 +36,14 @@ function shapely_setup() {
3636 'flex-width ' => true ,
3737 ) );
3838
39+ add_theme_support ( 'custom-header ' , apply_filters ( 'shapely_custom_header_args ' , array (
40+ 'default-image ' => '' ,
41+ 'default-text-color ' => '000000 ' ,
42+ 'width ' => 1900 ,
43+ 'height ' => 225 ,
44+ 'flex-width ' => true
45+ ) ) );
46+
3947 /*
4048 * Let WordPress manage the document title.
4149 * By adding theme support, we declare that this theme does not use a
@@ -53,7 +61,8 @@ function shapely_setup() {
5361
5462 // This theme uses wp_nav_menu() in one location.
5563 register_nav_menus ( array (
56- 'primary ' => esc_html__ ( 'Primary ' , 'shapely ' ),
64+ 'primary ' => esc_html__ ( 'Primary ' , 'shapely ' ),
65+ 'social-menu ' => esc_html__ ( 'Social Menu ' , 'shapely ' ),
5766 ) );
5867
5968 /*
@@ -68,18 +77,6 @@ function shapely_setup() {
6877 'caption ' ,
6978 ) );
7079
71- /*
72- * Enable support for Post Formats.
73- * See https://developer.wordpress.org/themes/functionality/post-formats/
74- */
75- add_theme_support ( 'post-formats ' , array (
76- 'aside ' ,
77- 'image ' ,
78- 'video ' ,
79- 'quote ' ,
80- 'link ' ,
81- ) );
82-
8380 // Set up the WordPress core custom background feature.
8481 add_theme_support ( 'custom-background ' , apply_filters ( 'shapely_custom_background_args ' , array (
8582 'default-color ' => 'ffffff ' ,
@@ -92,16 +89,18 @@ function shapely_setup() {
9289 * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
9390 */
9491 add_theme_support ( 'post-thumbnails ' );
95-
96- add_image_size ( 'shapely-featured ' , 848 , 566 , true );
92+ add_image_size ( 'shapely-full ' , 1110 , 530 , true );
93+ add_image_size ( 'shapely-featured ' , 730 , 350 , true );
94+ add_image_size ( 'shapely-grid ' , 350 , 300 , true );
9795
9896 add_theme_support ( 'customize-selective-refresh-widgets ' );
9997 // Welcome screen
10098 if ( is_admin () ) {
10199 global $ shapely_required_actions , $ shapely_recommended_plugins ;
102100
103101 $ shapely_recommended_plugins = array (
104- 'fancybox-for-wordpress ' => array ( 'recommended ' => false )
102+ 'wordpress-seo ' => array ( 'recommended ' => true ),
103+ 'fancybox-for-wordpress ' => array ( 'recommended ' => false ),
105104 );
106105
107106 /*
@@ -112,6 +111,14 @@ function shapely_setup() {
112111 * plugin_slug - the plugin's slug (used for installing the plugin)
113112 *
114113 */
114+ $ path = WPMU_PLUGIN_DIR . '/shapely-companion/inc/views/shapely-demo-content.php ' ;
115+ if ( ! file_exists ( $ path ) ) {
116+ $ path = WP_PLUGIN_DIR . '/shapely-companion/inc/views/shapely-demo-content.php ' ;
117+ if ( ! file_exists ( $ path ) ) {
118+ $ path = false ;
119+ }
120+ }
121+
115122 $ shapely_required_actions = array (
116123 array (
117124 "id " => 'shapely-req-ac-install-companion-plugin ' ,
@@ -128,17 +135,10 @@ function shapely_setup() {
128135 "plugin_slug " => 'jetpack '
129136 ),
130137 array (
131- "id " => 'shapely-req-ac-install-wp-yoast-plugin ' ,
132- "title " => Shapely_Notify_System::shapely_yoast_title (),
133- 'description ' => Shapely_Notify_System::shapely_yoast_description (),
134- "check " => Shapely_Notify_System::shapely_has_plugin ( 'wordpress-seo ' ),
135- "plugin_slug " => 'wordpress-seo '
136- ),
137- array (
138- "id " => 'shapely-req-import-content ' ,
139- "title " => esc_html__ ( 'Import content ' , 'shapely ' ),
140- "external " => ABSPATH . 'wp-content/plugins/shapely-companion/inc/views/shapely-demo-content.php ' ,
141- "check " => Shapely_Notify_System::shapely_check_import_req (),
138+ "id " => 'shapely-req-import-content ' ,
139+ "title " => esc_html__ ( 'Import content ' , 'shapely ' ),
140+ "external " => $ path ,
141+ "check " => Shapely_Notify_System::shapely_check_import_req (),
142142 ),
143143
144144 );
@@ -202,6 +202,27 @@ function shapely_widgets_init() {
202202
203203add_action ( 'widgets_init ' , 'shapely_widgets_init ' );
204204
205+ /**
206+ * Hides the custom post template for pages on WordPress 4.6 and older
207+ *
208+ * @param array $post_templates Array of page templates. Keys are filenames, values are translated names.
209+ *
210+ * @return array Filtered array of page templates.
211+ */
212+ function shapely_exclude_page_templates ( $ post_templates ) {
213+
214+ if ( version_compare ( $ GLOBALS ['wp_version ' ], '4.7 ' , '< ' ) ) {
215+ unset( $ post_templates ['page-templates/full-width.php ' ] );
216+ unset( $ post_templates ['page-templates/no-sidebar.php ' ] );
217+ unset( $ post_templates ['page-templates/sidebar-left.php ' ] );
218+ unset( $ post_templates ['page-templates/sidebar-right.php ' ] );
219+ }
220+
221+ return $ post_templates ;
222+ }
223+
224+ add_filter ( 'theme_page_templates ' , 'shapely_exclude_page_templates ' );
225+
205226/**
206227 * Enqueue scripts and styles.
207228 */
@@ -241,17 +262,20 @@ function shapely_scripts() {
241262 if ( is_page_template ( 'template-home.php ' ) ) {
242263 wp_enqueue_script ( 'shapely-parallax ' , get_template_directory_uri () . '/js/parallax.min.js ' , array ( 'jquery ' ), '20160115 ' , true );
243264 }
265+ /**
266+ * OwlCarousel Library
267+ */
268+ wp_enqueue_script ( 'owl.carousel ' , get_template_directory_uri () . '/js/owl-carousel/owl.carousel.min.js ' , array ( 'jquery ' ), '20160115 ' , true );
269+ wp_enqueue_style ( 'owl.carousel ' , get_template_directory_uri () . '/js/owl-carousel/owl.carousel.min.css ' );
270+ wp_enqueue_style ( 'owl.carousel ' , get_template_directory_uri () . '/js/owl-carousel/owl.theme.default.css ' );
244271
245272 wp_enqueue_script ( 'shapely-scripts ' , get_template_directory_uri () . '/js/shapely-scripts.js ' , array ( 'jquery ' ), '20160115 ' , true );
273+
274+ wp_enqueue_style ( 'shapely-scss ' , get_template_directory_uri () . '/assets/css/style.css ' );
246275}
247276
248277add_action ( 'wp_enqueue_scripts ' , 'shapely_scripts ' );
249278
250- /**
251- * Implement the Custom Header feature.
252- */
253- require get_template_directory () . '/inc/custom-header.php ' ;
254-
255279/**
256280 * Custom template tags for this theme.
257281 */
@@ -283,19 +307,9 @@ function shapely_scripts() {
283307require get_template_directory () . '/inc/socialnav.php ' ;
284308
285309/**
286- * Load Metboxes
310+ * Load related posts
287311 */
288- require get_template_directory () . '/inc/metaboxes.php ' ;
289-
290- /* Globals */
291- global $ shapely_site_layout ;
292- $ shapely_site_layout = array (
293- 'pull-right ' => esc_html__ ( 'Left Sidebar ' , 'shapely ' ),
294- 'side-right ' => esc_html__ ( 'Right Sidebar ' , 'shapely ' ),
295- 'no-sidebar ' => esc_html__ ( 'No Sidebar ' , 'shapely ' ),
296- 'full-width ' => esc_html__ ( 'Full Width ' , 'shapely ' )
297- );
298-
312+ require get_template_directory () . '/inc/class-shapely-related-posts.php ' ;
299313
300314/**
301315 * Load the system checks ( used for notifications )
0 commit comments