From a94ef26d8f90324bd21102518fa73a2bb8310423 Mon Sep 17 00:00:00 2001 From: claudiuvertistudio Date: Wed, 15 Jun 2016 11:58:03 +0300 Subject: [PATCH 01/15] !!! #43 Confusing terms --- inc/customizer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/customizer.php b/inc/customizer.php index daef8a0..601aa1b 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -55,7 +55,7 @@ function zillah_customize_register( $wp_customize ) { $wp_customize->add_control('zillah_sidebar_show', array( 'label' => esc_html__('Show sidebar', 'zillah'), - 'description' => esc_html__('If you check this box, the sidebar will appear.', 'zillah'), + 'description' => esc_html__('If you check this box, the sidebar will appear on homepage and archive page.', 'zillah'), 'section' => 'zillah_home_theme_option_section', 'priority' => 1, 'type' => 'checkbox', From 7e74b74e5e3eb8077bac0f8860469f92edc44447 Mon Sep 17 00:00:00 2001 From: claudiuvertistudio Date: Wed, 15 Jun 2016 14:54:30 +0300 Subject: [PATCH 02/15] !!! #106 Image padding in content --- style.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/style.css b/style.css index 99151b0..dce238f 100644 --- a/style.css +++ b/style.css @@ -380,6 +380,13 @@ blockquote { margin: 50px 0; } +.entry-content a img, +.entry-summary a img, +.comment-content a img, +.textwidget a img { + display: block; +} + address { margin: 0 0 1.5em; } From 0ab45f32bf453f9cfac3f1a198a1928e8266daf6 Mon Sep 17 00:00:00 2001 From: claudiuvertistudio Date: Wed, 15 Jun 2016 15:08:00 +0300 Subject: [PATCH 03/15] !!! #95 Retina logo --- functions.php | 4 ++-- style.css | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/functions.php b/functions.php index 7b5b658..3101b29 100644 --- a/functions.php +++ b/functions.php @@ -84,8 +84,8 @@ function zillah_setup() { // Add theme support for custom logo add_theme_support( 'custom-logo', array( - 'height' => 145, - 'width' => 315, + 'height' => 290, + 'width' => 630, 'flex-width' => true, ) ); } diff --git a/style.css b/style.css index dce238f..622d939 100644 --- a/style.css +++ b/style.css @@ -1324,7 +1324,7 @@ p.dropcap:first-letter { ## Blog --------------------------------------------------------------*/ .post-thumbnail { - display: inline-block; + display: block; } .post-thumbnail-wrap { @@ -1334,7 +1334,7 @@ p.dropcap:first-letter { } .post-thumbnail-wrap img { - max-height: 438px; + width: 100%; } .entry-title-blog { @@ -1933,6 +1933,11 @@ object { line-height: 20px; } +.header-logo-wrap img { + max-height: 145px; + width: auto; +} + .social-navigation a[href*="twitter.com"]::before { content: '\f099'; } @@ -3118,10 +3123,6 @@ div.sharedaddy h3.sd-title:before { max-width: 840px; } - .post-thumbnail-wrap img { - max-height: 545px; - } - } From 1704ec8465410c9bf5237b47c6bd40c4d2de4289 Mon Sep 17 00:00:00 2001 From: claudiuvertistudio Date: Wed, 15 Jun 2016 15:44:57 +0300 Subject: [PATCH 04/15] !!! #89 Child theme issue --- functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.php b/functions.php index 3101b29..138e30a 100644 --- a/functions.php +++ b/functions.php @@ -234,7 +234,7 @@ function zillah_scripts() { function zillah_customizer_script() { wp_enqueue_style( 'zillah-font-awesome-admin', get_template_directory_uri() . '/css/font-awesome.min.css', array(), 'v4.5.0', false ); wp_enqueue_script( 'zillah-customizer-script', get_template_directory_uri() .'/js/zillah-customizer.js', array( 'jquery' ), '1.0.1', true ); - wp_enqueue_style( 'zillah-admin-stylesheet', get_stylesheet_directory_uri().'/css/admin-style.css','1.0.0' ); + wp_enqueue_style( 'zillah-admin-stylesheet', get_template_directory_uri() .'/css/admin-style.css','1.0.0' ); } add_action( 'customize_controls_enqueue_scripts', 'zillah_customizer_script' ); From d35cc23e4a153ce556e6699d74dc02e17da4a4cb Mon Sep 17 00:00:00 2001 From: claudiuvertistudio Date: Thu, 16 Jun 2016 16:10:35 +0300 Subject: [PATCH 05/15] #24 Fonts control --- css/admin-style.css | 35 +++++++- functions.php | 68 +++++++++++++++- inc/class/zillah-google-fonts.php | 42 ++++++++++ inc/customizer.php | 129 ++++++++++++++++++++++++++++++ js/zillah-customizer.js | 14 +++- style.css | 1 + 6 files changed, 286 insertions(+), 3 deletions(-) create mode 100644 inc/class/zillah-google-fonts.php diff --git a/css/admin-style.css b/css/admin-style.css index b18eec2..ce8aa09 100644 --- a/css/admin-style.css +++ b/css/admin-style.css @@ -245,4 +245,37 @@ button.zillah_general_control_remove_field:hover{ .zillah_pallete_default { line-height: 40px; cursor: pointer; -} \ No newline at end of file +} + +/***********************************/ +/****** Google fonts Control *******/ +/***********************************/ +.ti-google-fonts-wrap { + background: rgba(255, 255, 255, 0.75); + padding: 10px; + border: 1px solid #ddd; + max-height: 140px; + overflow-y: auto; + overflow-x: auto; +} + +.ti-google-fonts-wrap label { + width: 100%; + display: block; + clear: left; + font-size: 16px; + line-height: 28px; + overflow: hidden; + position: relative; +} + +.ti-google-fonts-wrap label input { + position: absolute; + left: -9999px; +} + +.ti-google-fonts-wrap label:hover, +.ti-google-fonts-wrap label.ti-google-fonts-active { + color: #0073aa; +} + diff --git a/functions.php b/functions.php index 138e30a..d5f3a13 100644 --- a/functions.php +++ b/functions.php @@ -477,11 +477,19 @@ function zillah_php_style() { $header_text_color = get_header_textcolor(); + $zillah_first_font_one = get_theme_mod( 'zillah_google_fonts_one' ); + $zillah_first_font_two = get_theme_mod( 'zillah_google_fonts_two' ); + $zillah_first_font_one = explode( '|', $zillah_first_font_one ); + $zillah_first_font_two = explode( '|', $zillah_first_font_two ); + + $zillah_font_size = get_theme_mod( 'example_select_box', '16px' ); + if( isset( $zillah_c5 ) ) { $rgb = zillah_get_rgb( $zillah_c5 ); } echo ''; } diff --git a/inc/class/zillah-google-fonts.php b/inc/class/zillah-google-fonts.php new file mode 100644 index 0000000..bb7ccdc --- /dev/null +++ b/inc/class/zillah-google-fonts.php @@ -0,0 +1,42 @@ +options = $args; + $this->control_id = $id; + } + + public function render_content() { + $options = $this->options; + $control_id = $this->control_id; + + $ti_google_fonts = ''; + foreach( $options['ti_google_fonts'] as $zilla_font ) { + $ti_input_value = implode( '|', $zilla_font); + $ti_google_fonts .= ''; + } + + // Hackily add in the data link parameter. + $ti_google_fonts = str_replace( 'get_link(), $ti_google_fonts ); + + printf( + '
%s
%s
', + $this->label, + $ti_google_fonts + ); + + } + + } +} +?> \ No newline at end of file diff --git a/inc/customizer.php b/inc/customizer.php index 601aa1b..58243c4 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -17,6 +17,7 @@ function zillah_customize_register( $wp_customize ) { $wp_customize->get_setting( 'header_textcolor' )->default = '#7fcaad'; require_once ( 'class/zillah_category-selector-control.php'); + require_once ( 'class/zillah-google-fonts.php'); $wp_customize->get_control( 'blogname' )->priority = 3; $wp_customize->get_control( 'blogdescription' )->priority = 4; @@ -133,6 +134,134 @@ function zillah_customize_register( $wp_customize ) { 'metro_customizr_link_control' => true ) ) ); + + + + + + + /* Fonts */ + $wp_customize->add_section( 'zillah_fonts_section', array( + 'title' => esc_html__( 'Fonts', 'zillah' ), + 'priority' => 90, + ) ); + + + /* Google fonts */ + $wp_customize->add_setting('zillah_google_fonts_one', array( + 'default' => 0, + 'sanitize_callback' => 'sanitize_text_field', + )); + + $wp_customize->add_control( + new Zillah_Google_Fonts_Control( + $wp_customize, + 'zillah_google_fonts_one', + array( + 'label' => 'Select first font family ( content )', + 'section' => 'zillah_fonts_section', + 'priority' => 1, + 'ti_google_fonts' => array( + array( + 'font_family' => 'Merriweather', + 'type' => 'serif', + 'subset' => '400', + ), + array( + 'font_family'=>'Open Sans', + 'type' => 'sans-serif', + 'subset'=>'400', + ), + array( + 'font_family'=>'Josefin Slab', + 'type' => 'serif', + 'subset'=>'400', + ), + array( + 'font_family'=>'Ubuntu', + 'type' => 'sans-serif', + 'subset'=>'400', + ), + array( + 'font_family'=>'Vollkorn', + 'type' => 'serif', + 'subset'=>'400', + ), + ), + ) + ) + ); + + + $wp_customize->add_setting('zillah_google_fonts_two', array( + 'default' => 0, + 'sanitize_callback' => 'sanitize_text_field', + )); + + $wp_customize->add_control( + new Zillah_Google_Fonts_Control( + $wp_customize, + 'zillah_google_fonts_two', + array( + 'label' => 'Select second font family ( headings )', + 'section' => 'zillah_fonts_section', + 'priority' => 1, + 'ti_google_fonts' => array( + array( + 'font_family'=>'Cabin', + 'type' => 'sans-serif', + 'subset'=>'400', + ), + array( + 'font_family'=>'Lato', + 'type' => 'sans-serif', + 'subset'=>'400', + ), + array( + 'font_family' => 'Arvo', + 'type' => 'serif', + 'subset'=>'400', + ), + array( + 'font_family'=>'Open Sans', + 'type' => 'sans-serif', + 'subset'=>'400', + ), + array( + 'font_family'=>'Ubuntu', + 'type' => 'sans-serif', + 'subset'=>'400', + ), + ), + ) + ) + ); + + /* Font size */ + $wp_customize->add_setting('example_select_box', array( + 'default' => '16px', + )); + $wp_customize->add_control( 'example_select_box', array( + 'label' => 'Select Something:', + 'section' => 'zillah_fonts_section', + 'type' => 'select', + 'choices' => array( + '14px' => 'Small', + '16px' => 'Medium', + '18px' => 'Large', + ), + )); + + + + + + + + + + + } add_action( 'customize_register', 'zillah_customize_register' ); diff --git a/js/zillah-customizer.js b/js/zillah-customizer.js index 778fef4..69da24b 100644 --- a/js/zillah-customizer.js +++ b/js/zillah-customizer.js @@ -38,4 +38,16 @@ jQuery(document).ready(function () { th.parent().parent().find('.zillah_palette_colector').trigger('change'); } }); -}); \ No newline at end of file +}); + + + +jQuery( document ).ready( function() { + + jQuery( '.ti-google-fonts input:radio:checked' ).parent( 'label' ).addClass( 'ti-google-fonts-active' ); + jQuery( '.ti-google-fonts input' ).click( function() { + jQuery( this ).parent().parent().find( '.ti-google-fonts-active' ).removeClass( 'ti-google-fonts-active' ); + jQuery( this ).parent().addClass( 'ti-google-fonts-active' ); + }); + +}); diff --git a/style.css b/style.css index 622d939..b877ce3 100644 --- a/style.css +++ b/style.css @@ -3036,6 +3036,7 @@ div.sharedaddy h3.sd-title:before { .carousel-caption-category { margin: 0; padding: 0; + color: #aaaaaa; } .carousel-caption-category a { From 7d149fbcedd58df824ce3244e143056f439648db Mon Sep 17 00:00:00 2001 From: claudiuvertistudio Date: Thu, 16 Jun 2016 16:59:26 +0300 Subject: [PATCH 06/15] !!! #24 Moved fonts control to theme options --- inc/customizer.php | 165 ++++++++++++++++++--------------------------- 1 file changed, 65 insertions(+), 100 deletions(-) diff --git a/inc/customizer.php b/inc/customizer.php index 58243c4..941e7af 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -134,116 +134,91 @@ function zillah_customize_register( $wp_customize ) { 'metro_customizr_link_control' => true ) ) ); - - - - - - - /* Fonts */ - $wp_customize->add_section( 'zillah_fonts_section', array( - 'title' => esc_html__( 'Fonts', 'zillah' ), - 'priority' => 90, - ) ); - - /* Google fonts */ $wp_customize->add_setting('zillah_google_fonts_one', array( 'default' => 0, 'sanitize_callback' => 'sanitize_text_field', )); - $wp_customize->add_control( - new Zillah_Google_Fonts_Control( - $wp_customize, - 'zillah_google_fonts_one', + $wp_customize->add_control( new Zillah_Google_Fonts_Control( $wp_customize, 'zillah_google_fonts_one', array( + 'label' => 'Select first font family ( content )', + 'section' => 'zillah_home_theme_option_section', + 'priority' => 4, + 'ti_google_fonts' => array( array( - 'label' => 'Select first font family ( content )', - 'section' => 'zillah_fonts_section', - 'priority' => 1, - 'ti_google_fonts' => array( - array( - 'font_family' => 'Merriweather', - 'type' => 'serif', - 'subset' => '400', - ), - array( - 'font_family'=>'Open Sans', - 'type' => 'sans-serif', - 'subset'=>'400', - ), - array( - 'font_family'=>'Josefin Slab', - 'type' => 'serif', - 'subset'=>'400', - ), - array( - 'font_family'=>'Ubuntu', - 'type' => 'sans-serif', - 'subset'=>'400', - ), - array( - 'font_family'=>'Vollkorn', - 'type' => 'serif', - 'subset'=>'400', - ), - ), - ) - ) - ); - + 'font_family' => 'Merriweather', + 'type' => 'serif', + 'subset' => '400', + ), + array( + 'font_family'=>'Open Sans', + 'type' => 'sans-serif', + 'subset'=>'400', + ), + array( + 'font_family'=>'Josefin Slab', + 'type' => 'serif', + 'subset'=>'400', + ), + array( + 'font_family'=>'Ubuntu', + 'type' => 'sans-serif', + 'subset'=>'400', + ), + array( + 'font_family'=>'Vollkorn', + 'type' => 'serif', + 'subset'=>'400', + ), + ), + ))); $wp_customize->add_setting('zillah_google_fonts_two', array( 'default' => 0, 'sanitize_callback' => 'sanitize_text_field', )); - $wp_customize->add_control( - new Zillah_Google_Fonts_Control( - $wp_customize, - 'zillah_google_fonts_two', + $wp_customize->add_control( new Zillah_Google_Fonts_Control( $wp_customize, 'zillah_google_fonts_two', array( + 'label' => 'Select second font family ( headings )', + 'section' => 'zillah_home_theme_option_section', + 'priority' => 5, + 'ti_google_fonts' => array( + array( + 'font_family'=>'Cabin', + 'type' => 'sans-serif', + 'subset'=>'400', + ), array( - 'label' => 'Select second font family ( headings )', - 'section' => 'zillah_fonts_section', - 'priority' => 1, - 'ti_google_fonts' => array( - array( - 'font_family'=>'Cabin', - 'type' => 'sans-serif', - 'subset'=>'400', - ), - array( - 'font_family'=>'Lato', - 'type' => 'sans-serif', - 'subset'=>'400', - ), - array( - 'font_family' => 'Arvo', - 'type' => 'serif', - 'subset'=>'400', - ), - array( - 'font_family'=>'Open Sans', - 'type' => 'sans-serif', - 'subset'=>'400', - ), - array( - 'font_family'=>'Ubuntu', - 'type' => 'sans-serif', - 'subset'=>'400', - ), - ), - ) - ) - ); + 'font_family'=>'Lato', + 'type' => 'sans-serif', + 'subset'=>'400', + ), + array( + 'font_family' => 'Arvo', + 'type' => 'serif', + 'subset'=>'400', + ), + array( + 'font_family'=>'Open Sans', + 'type' => 'sans-serif', + 'subset'=>'400', + ), + array( + 'font_family'=>'Ubuntu', + 'type' => 'sans-serif', + 'subset'=>'400', + ), + ), + ))); /* Font size */ $wp_customize->add_setting('example_select_box', array( - 'default' => '16px', + 'default' => '16px', )); $wp_customize->add_control( 'example_select_box', array( 'label' => 'Select Something:', - 'section' => 'zillah_fonts_section', + 'section' => 'zillah_home_theme_option_section', + 'priority' => 6, 'type' => 'select', 'choices' => array( '14px' => 'Small', @@ -252,16 +227,6 @@ function zillah_customize_register( $wp_customize ) { ), )); - - - - - - - - - - } add_action( 'customize_register', 'zillah_customize_register' ); From 538e4c31d9e1a794b7d2d7dd076b21df7bbed216 Mon Sep 17 00:00:00 2001 From: claudiuvertistudio Date: Fri, 17 Jun 2016 14:02:38 +0300 Subject: [PATCH 07/15] Added option to add logo in versions older than 4.5 --- functions.php | 5 +++++ inc/customizer.php | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/functions.php b/functions.php index d5f3a13..a37051d 100644 --- a/functions.php +++ b/functions.php @@ -314,6 +314,11 @@ function zillah_brand(){ if ( function_exists( 'the_custom_logo' ) ) { the_custom_logo(); + } else { + $zillah_logo_old = get_theme_mod( 'zillah_logo_old', false ); + echo ''; } if( ( ! $zillah_tagline_hide && display_header_text() ) || is_customize_preview() ) { diff --git a/inc/customizer.php b/inc/customizer.php index 941e7af..e4bb2cc 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -215,6 +215,7 @@ function zillah_customize_register( $wp_customize ) { $wp_customize->add_setting('example_select_box', array( 'default' => '16px', )); + $wp_customize->add_control( 'example_select_box', array( 'label' => 'Select Something:', 'section' => 'zillah_home_theme_option_section', @@ -227,6 +228,19 @@ function zillah_customize_register( $wp_customize ) { ), )); + if( ! $custom_logo ) { + + $wp_customize->add_setting( 'zillah_logo_old' ); + + $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'zillah_logo_old', array( + 'label' => __( 'Logo', 'zillah' ), + 'section' => 'title_tagline', + 'settings' => 'zillah_logo_old', + ) ) ); + + } + + } add_action( 'customize_register', 'zillah_customize_register' ); From 76b075fcdde5393fc5a264e88552b9421c54486a Mon Sep 17 00:00:00 2001 From: claudiuvertistudio Date: Fri, 17 Jun 2016 14:14:38 +0300 Subject: [PATCH 08/15] !!! Show gravatar only if name or description exists --- functions.php | 4 ++- template-parts/content-single.php | 43 +++++++++++++++++-------------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/functions.php b/functions.php index a37051d..e0f274b 100644 --- a/functions.php +++ b/functions.php @@ -525,6 +525,7 @@ function zillah_php_style() { p.dropcap:first-letter, .site-footer .fa, .author-details-title, + .author-details-title a:visited, .entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a { color:'.$zillah_c2.'; } @@ -564,7 +565,8 @@ function zillah_php_style() { .main-navigation li:hover > a, .main-navigation li.focus > a, a.post-edit-link:hover, - .tags-links a:hover { + .tags-links a:hover, + .author-details-title a:hover { color: '.$zillah_c3.'; } a.more-link:hover, diff --git a/template-parts/content-single.php b/template-parts/content-single.php index 0e14551..662bb31 100644 --- a/template-parts/content-single.php +++ b/template-parts/content-single.php @@ -56,15 +56,19 @@ -
-
-
- -
- '; + echo '
'; + + echo '
'; + echo get_avatar( get_the_author_meta( 'user_email' ), '100' ); + echo '
'; $author_name = ''; if ( ! empty( $author_first_name ) ) { @@ -79,13 +83,14 @@ echo '' . $author_name . ''; } echo '
'; - } - - $author_description = wp_kses_post( nl2br( get_the_author_meta('description') ) ); - if( !empty( $author_description ) ){ - echo '
' . $author_description . '
'; - } - ?> - -
-
\ No newline at end of file + + if( !empty( $author_description ) ){ + echo '
' . $author_description . '
'; + } + + echo ''; + echo ''; + + } +?> + From a16b9027a1c44f9639386a875c288b339323eae5 Mon Sep 17 00:00:00 2001 From: claudiuvertistudio Date: Fri, 17 Jun 2016 17:19:13 +0300 Subject: [PATCH 09/15] Added style for post format video and gallery --- functions.php | 75 ++++++++++++++++++++++++++++++++++---- js/functions.js | 4 ++ style.css | 8 ++++ template-parts/content.php | 19 +++++++++- 4 files changed, 98 insertions(+), 8 deletions(-) diff --git a/functions.php b/functions.php index e0f274b..33d7a0a 100644 --- a/functions.php +++ b/functions.php @@ -69,11 +69,15 @@ function zillah_setup() { * See https://developer.wordpress.org/themes/functionality/post-formats/ */ add_theme_support( 'post-formats', array( -// 'aside', -// 'image', -// 'video', -// 'quote', -// 'link', + 'aside', + 'image', + 'video', + 'quote', + 'link', + 'gallery', + 'status', + 'audio', + 'chat', ) ); // Set up the WordPress core custom background feature. @@ -722,7 +726,7 @@ function custom_excerpt_length( $length ) { } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); - +/* Post image */ function zillah_post_image() { if ( has_post_thumbnail() ) { echo '
'; @@ -739,7 +743,7 @@ function zillah_post_image() { } } - +/* Get the first image from post */ function zillah_catch_that_image() { global $post, $posts; $first_img = false; @@ -749,3 +753,60 @@ function zillah_catch_that_image() { $first_img = ! empty( $matches[1][0] ) ? $matches[1][0] : false; return $first_img; } + +/* Get first embed media */ +function zillah_get_first_embed_media($post_id) { + $post = get_post($post_id); + $content = do_shortcode( apply_filters( 'the_content', $post->post_content ) ); + $embeds = get_media_embedded_in_content( $content ); + if( !empty($embeds) ) { + //check what is the first embed containg video tag, youtube or vimeo + foreach( $embeds as $embed ) { + if( strpos( $embed, 'video' ) || strpos( $embed, 'youtube' ) || strpos( $embed, 'vimeo' ) ) { + return $embed; + } + } + } else { + //No video embedded found + return false; + } +} + + +/* Get gallery */ +function zillah_get_gallery() { + + if ( get_post_gallery() ) : + $gallery = get_post_gallery( get_the_ID(), false ); + + if( isset( $gallery['ids'] ) ) { + $ids = explode( ",", $gallery['ids'] ); + } else { + return false; + } + + if ( $ids ) { + echo '
+ '; + } + endif; + +} \ No newline at end of file diff --git a/js/functions.js b/js/functions.js index 2eb9d13..1a98f32 100644 --- a/js/functions.js +++ b/js/functions.js @@ -99,6 +99,10 @@ //ACCESSIBILITY MENU ( function( $ ) { + $( '#carousel-post-gallery' ).carousel({ + interval: 500 + }); + function initMainNavigation( container ) { // Add dropdown toggle that display child menu items. container.find( '.menu-item-has-children > a' ).after( '' ); diff --git a/style.css b/style.css index b877ce3..7f3f254 100644 --- a/style.css +++ b/style.css @@ -1333,6 +1333,14 @@ p.dropcap:first-letter { margin-bottom: 50px; } +.post-thumbnail-wrap iframe { + width: 100%; +} + +#carousel-post-gallery img { + width: 100%; +} + .post-thumbnail-wrap img { width: 100%; } diff --git a/template-parts/content.php b/template-parts/content.php index a7e811c..27fa7e3 100644 --- a/template-parts/content.php +++ b/template-parts/content.php @@ -22,7 +22,24 @@ '; + echo zillah_get_first_embed_media( get_the_ID() ); + echo '
'; + } else if( $post_format === 'gallery' ) { + if ( has_post_thumbnail() ) { + echo '
'; + the_post_thumbnail(); + echo '
'; + } else { + echo '
'; + zillah_get_gallery(); + echo '
'; + } + } else { + zillah_post_image(); + } ?>
From 931cd18e50f5f2a1950efb16530743031f8dde42 Mon Sep 17 00:00:00 2001 From: Buruiana Claudiu Date: Sun, 19 Jun 2016 10:45:17 +0300 Subject: [PATCH 10/15] #65 Post format support --- functions.php | 103 ++++++++++++++++++++++++++++--------- js/functions.js | 10 ++-- style.css | 16 ++++++ template-parts/content.php | 65 ++++++++++++----------- 4 files changed, 132 insertions(+), 62 deletions(-) diff --git a/functions.php b/functions.php index 33d7a0a..8f92bc4 100644 --- a/functions.php +++ b/functions.php @@ -726,23 +726,46 @@ function custom_excerpt_length( $length ) { } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); +/* Post thumbnail */ +function zillah_post_thumbnail() { + $post_format = get_post_format(); + if ( has_post_thumbnail() ) { + echo '
'; + echo ''; + the_post_thumbnail(); + echo ''; + echo '
'; + } else { + $post_image_link = zillah_catch_that_image(); + $zillah_image_as_thumbnail = get_theme_mod( 'zillah_image_as_thumbnail', false ); + if( $post_image_link && $zillah_image_as_thumbnail ) { + echo '
'; + echo ''; + echo ''. esc_attr( get_the_title() ) .''; + echo ''; + echo '
'; + } + } +} + + /* Post image */ function zillah_post_image() { if ( has_post_thumbnail() ) { echo '
'; the_post_thumbnail(); - echo '
'; + echo '
'; } else { $post_image_link = zillah_catch_that_image(); - $zillah_image_as_thumbnail = get_theme_mod( 'zillah_image_as_thumbnail', false ); - if( $post_image_link && $zillah_image_as_thumbnail ) { + if( $post_image_link ) { echo '
'; echo ''. esc_attr( get_the_title() ) .''; - echo '
'; + echo '
'; } } } + /* Get the first image from post */ function zillah_catch_that_image() { global $post, $posts; @@ -754,6 +777,7 @@ function zillah_catch_that_image() { return $first_img; } + /* Get first embed media */ function zillah_get_first_embed_media($post_id) { $post = get_post($post_id); @@ -774,7 +798,7 @@ function zillah_get_first_embed_media($post_id) { /* Get gallery */ -function zillah_get_gallery() { +function zillah_post_gallery() { if ( get_post_gallery() ) : $gallery = get_post_gallery( get_the_ID(), false ); @@ -786,27 +810,56 @@ function zillah_get_gallery() { } if ( $ids ) { - echo '
- From 51c62a87f78884964dfe7e9d78193d03d5fd599e Mon Sep 17 00:00:00 2001 From: Buruiana Claudiu Date: Sun, 19 Jun 2016 10:57:05 +0300 Subject: [PATCH 11/15] #65 Post format support --- functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.php b/functions.php index 8f92bc4..11e8d93 100644 --- a/functions.php +++ b/functions.php @@ -860,6 +860,6 @@ function zillah_post_video() { } echo '
'; } - + } From 0d98c0d4a16ca7136a45be396f4fb33111479c15 Mon Sep 17 00:00:00 2001 From: rodica-andronache Date: Tue, 21 Jun 2016 12:44:10 +0300 Subject: [PATCH 12/15] #24 Small changes for custom fonts control --- functions.php | 293 ++++++++++++++++++++++++--------------------- inc/customizer.php | 6 +- 2 files changed, 160 insertions(+), 139 deletions(-) diff --git a/functions.php b/functions.php index 11e8d93..3b84b2e 100644 --- a/functions.php +++ b/functions.php @@ -488,10 +488,15 @@ function zillah_php_style() { $zillah_first_font_one = get_theme_mod( 'zillah_google_fonts_one' ); $zillah_first_font_two = get_theme_mod( 'zillah_google_fonts_two' ); - $zillah_first_font_one = explode( '|', $zillah_first_font_one ); - $zillah_first_font_two = explode( '|', $zillah_first_font_two ); - $zillah_font_size = get_theme_mod( 'example_select_box', '16px' ); + if( !empty($zillah_first_font_one) ) { + $zillah_first_font_one = explode( '|', $zillah_first_font_one ); + } + if( !empty($zillah_first_font_two) ) { + $zillah_first_font_two = explode( '|', $zillah_first_font_two ); + } + + $zillah_font_size = get_theme_mod( 'zillah_select_box_font_size', '16px' ); if( isset( $zillah_c5 ) ) { $rgb = zillah_get_rgb( $zillah_c5 ); @@ -502,123 +507,133 @@ function zillah_php_style() { if(!empty($zillah_palette_picker)){ /* Color 1 */ - echo ' - .post-navigation .nav-links a, - .posts-navigation .nav-previous a, - .posts-navigation .nav-previous a, - .posts-navigation .nav-next a { - background: '.$zillah_c1.'; - opacity: 1; - } - .post-navigation .nav-links a:hover, - .posts-navigation .nav-previous a:hover, - .posts-navigation .nav-previous a:hover, - .posts-navigation .nav-next a:hover { - background: '.$zillah_c1.'; - opacity: 0.8; - } - '; + if( !empty($zillah_c1) ) { + echo ' + .post-navigation .nav-links a, + .posts-navigation .nav-previous a, + .posts-navigation .nav-previous a, + .posts-navigation .nav-next a { + background: ' . $zillah_c1 . '; + opacity: 1; + } + .post-navigation .nav-links a:hover, + .posts-navigation .nav-previous a:hover, + .posts-navigation .nav-previous a:hover, + .posts-navigation .nav-next a:hover { + background: ' . $zillah_c1 . '; + opacity: 0.8; + } + '; + } /* Color 2 */ - echo ' - .widget-title { - color: '.$zillah_c2.'; - } - a, .entry-content a:visited, .comment-content a:visited, - .cat-links, .entry-header .cat-links, .cat-links a, - p.dropcap:first-letter, - .site-footer .fa, - .author-details-title, - .author-details-title a:visited, - .entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a { - color:'.$zillah_c2.'; - } - button, input[type="button"], input[type="reset"], input[type="submit"], .btn { - background: '.$zillah_c2.'; - } - blockquote { - border-left: solid 5px '.$zillah_c2.'; - } - a.more-link, - a.more-link:visited, - .reply a, - a.post-edit-link, a.post-edit-link:visited, - .site-title a, .site-title a:visited, - .tags-links a:visited, - .logged-in-as a, .logged-in-as a:visited { - color: '.$zillah_c2.'; - } - @media screen and (max-width: 991px) { - .main-navigation { - background: '.$zillah_c2.'; + if( !empty($zillah_c2) ) { + echo ' + .widget-title { + color: ' . $zillah_c2 . '; } - } - '; + a, .entry-content a:visited, .comment-content a:visited, + .cat-links, .entry-header .cat-links, .cat-links a, + p.dropcap:first-letter, + .site-footer .fa, + .author-details-title, + .author-details-title a:visited, + .entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a { + color:' . $zillah_c2 . '; + } + button, input[type="button"], input[type="reset"], input[type="submit"], .btn { + background: ' . $zillah_c2 . '; + } + blockquote { + border-left: solid 5px ' . $zillah_c2 . '; + } + a.more-link, + a.more-link:visited, + .reply a, + a.post-edit-link, a.post-edit-link:visited, + .site-title a, .site-title a:visited, + .tags-links a:visited, + .logged-in-as a, .logged-in-as a:visited { + color: ' . $zillah_c2 . '; + } + @media screen and (max-width: 991px) { + .main-navigation { + background: ' . $zillah_c2 . '; + } + } + '; + } - echo ' - .site-title a, .site-title a:visited { - color: #'. esc_attr( $header_text_color ) .' - } - '; + if( !empty( $header_text_color ) ) { + echo ' + .site-title a, .site-title a:visited { + color: #' . esc_attr( $header_text_color ) . ' + } + '; + } /* Color 3 */ - echo ' - .main-navigation li:hover > a:hover, - .main-navigation li.focus > a:hover, - .widget li a:hover, - .main-navigation li:hover > a, - .main-navigation li.focus > a, - a.post-edit-link:hover, - .tags-links a:hover, - .author-details-title a:hover { - color: '.$zillah_c3.'; - } - a.more-link:hover, - a:hover, - .site-title a:hover, - .cat-links a:hover, - .entry-title-blog a:hover, - .carousel-caption-title a:hover, - .carousel-caption-category a:hover, - .social-navigation a:hover, - .widget-area .widget li a:hover, - .site-footer a:hover, - .menu-toggle:hover, .menu-toggle:focus, - .comment-metadata a:hover, .comment-author .fn a:hover, - .reply a:hover, - .entry-content a:hover, - .comment-content a:hover { - color:'.$zillah_c3.'; - } - @media screen and (max-width: 991px) { - .main-navigation ul ul { - background:'.$zillah_c3.'; - } - .dropdown-toggle, - .dropdown-toggle.toggled-on, - .dropdown-toggle.toggled-on:hover, - .dropdown-toggle.toggled-on:focus { - color: '.$zillah_c3.'; + if( !empty( $zillah_c3 ) ) { + echo ' + .main-navigation li:hover > a:hover, + .main-navigation li.focus > a:hover, + .widget li a:hover, + .main-navigation li:hover > a, + .main-navigation li.focus > a, + a.post-edit-link:hover, + .tags-links a:hover, + .author-details-title a:hover { + color: ' . $zillah_c3 . '; } - } - button:focus, - input[type="button"]:focus, - input[type="reset"]:focus, - input[type="submit"]:focus, - button:active, - input[type="button"]:active, - input[type="reset"]:active, - input[type="submit"]:active { - background:'.$zillah_c3.'; - } - '; + a.more-link:hover, + a:hover, + .site-title a:hover, + .cat-links a:hover, + .entry-title-blog a:hover, + .carousel-caption-title a:hover, + .carousel-caption-category a:hover, + .social-navigation a:hover, + .widget-area .widget li a:hover, + .site-footer a:hover, + .menu-toggle:hover, .menu-toggle:focus, + .comment-metadata a:hover, .comment-author .fn a:hover, + .reply a:hover, + .entry-content a:hover, + .comment-content a:hover { + color:' . $zillah_c3 . '; + } + @media screen and (max-width: 991px) { + .main-navigation ul ul { + background:' . $zillah_c3 . '; + } + .dropdown-toggle, + .dropdown-toggle.toggled-on, + .dropdown-toggle.toggled-on:hover, + .dropdown-toggle.toggled-on:focus { + color: ' . $zillah_c3 . '; + } + } + button:focus, + input[type="button"]:focus, + input[type="reset"]:focus, + input[type="submit"]:focus, + button:active, + input[type="button"]:active, + input[type="reset"]:active, + input[type="submit"]:active { + background:' . $zillah_c3 . '; + } + '; + } /* Color 5 */ - echo ' - body { - color: '.$zillah_c5.'; - } - '; + if( !empty( $zillah_c5 ) ) { + echo ' + body { + color: ' . $zillah_c5 . '; + } + '; + } echo ' .carousel-caption-title, @@ -642,24 +657,28 @@ function zillah_php_style() { } - echo ' - h4, h5, h6, - body, - button, - input, - select, - textarea, - .comment-reply-title, - h2.comments-title, - .site-info a, - .entry-content #jp-relatedposts h3.jp-relatedposts-headline, - .entry-content #jp-relatedposts h3.jp-relatedposts-headline em { - font-family: \''.$zillah_first_font_one[0].'\', '.$zillah_first_font_one[1].'; - font-wight: '.$zillah_first_font_one[2].'; - } - '; + if( !empty( $zillah_first_font_one[0] ) && !empty( $zillah_first_font_one[1] ) && !empty( $zillah_first_font_one[2] ) ) { + echo ' + h4, h5, h6, + body, + button, + input, + select, + textarea, + .comment-reply-title, + h2.comments-title, + .site-info a, + .entry-content #jp-relatedposts h3.jp-relatedposts-headline, + .entry-content #jp-relatedposts h3.jp-relatedposts-headline em { + font-family: \'' . $zillah_first_font_one[0] . '\', ' . $zillah_first_font_one[1] . '; + font-weight: ' . $zillah_first_font_one[2] . '; + } + '; + } + + if( !empty( $zillah_first_font_two[0] ) && !empty( $zillah_first_font_two[1] ) && !empty( $zillah_first_font_two[2] ) ) { - echo ' + echo ' h1, h2, h3, button, input[type="button"], @@ -689,16 +708,18 @@ function zillah_php_style() { .widget_categories li a , .widget_recent_entries .post-date, .carousel-caption-title a { - font-family: \''.$zillah_first_font_two[0].'\', '.$zillah_first_font_two[1].'; - font-wight: '.$zillah_first_font_two[2].'; + font-family: \'' . $zillah_first_font_two[0] . '\', ' . $zillah_first_font_two[1] . '; + font-weight: ' . $zillah_first_font_two[2] . '; }'; + } - - echo ' - body { - font-size: '.$zillah_font_size.'; - } - '; + if( !empty($zillah_font_size) ) { + echo ' + body { + font-size: ' . $zillah_font_size . '; + } + '; + } echo ''; } diff --git a/inc/customizer.php b/inc/customizer.php index e4bb2cc..23e7119 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -212,12 +212,12 @@ function zillah_customize_register( $wp_customize ) { ))); /* Font size */ - $wp_customize->add_setting('example_select_box', array( + $wp_customize->add_setting('zillah_select_box_font_size', array( 'default' => '16px', )); - $wp_customize->add_control( 'example_select_box', array( - 'label' => 'Select Something:', + $wp_customize->add_control( 'zillah_select_box_font_size', array( + 'label' => 'Select Font Size:', 'section' => 'zillah_home_theme_option_section', 'priority' => 6, 'type' => 'select', From e1d3a3a3b6cb4e8ef525e27ab70aff9bd36a9911 Mon Sep 17 00:00:00 2001 From: rodica-andronache Date: Tue, 21 Jun 2016 13:28:01 +0300 Subject: [PATCH 13/15] !!! Update style.css --- style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/style.css b/style.css index 1041c19..e9eec06 100644 --- a/style.css +++ b/style.css @@ -4,7 +4,7 @@ Theme URI: http://themeisle.com/themes/zillah/ Author: ThemeIsle Author URI: http://themeisle.com Description: Zillah is a free blogging WordPress theme. -Version: 1.0.6 +Version: 1.0.7 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Text Domain: zillah From 6b318696de3f63ca161c9c7e9a5fe4ea5370afb4 Mon Sep 17 00:00:00 2001 From: rodica-andronache Date: Tue, 21 Jun 2016 13:43:29 +0300 Subject: [PATCH 14/15] Added bootstrap to jshintigrone and fixed some js errors --- .jshintignore | 1 + js/customizer.js | 18 +++++++++--------- js/functions.js | 4 ++-- js/zillah-customizer.js | 5 ++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.jshintignore b/.jshintignore index dca3507..5ed67ca 100644 --- a/.jshintignore +++ b/.jshintignore @@ -1 +1,2 @@ js/bootstrap.min.js +js/bootstrap.js diff --git a/js/customizer.js b/js/customizer.js index ef15321..b10cce2 100644 --- a/js/customizer.js +++ b/js/customizer.js @@ -44,7 +44,7 @@ // Hide Site Title wp.customize( 'zillah_tagline_show', function( value ) { value.bind( function( to ) { - if( to != '' ) { + if( to !== '' ) { $( '.header-title-wrap' ).addClass( 'zillah-only-customizer' ); } else { @@ -57,7 +57,7 @@ // Logo wp.customize( 'custom_logo', function( value ) { value.bind( function( to ) { - if( to != '' ) { + if( to !== '' ) { $( '.custom-logo-link' ).removeClass( 'zillah-only-customizer' ); $( '.header-title-wrap' ).addClass( 'zillah-only-customizer' ); } @@ -71,7 +71,7 @@ // Slider wp.customize( 'zillah_home_slider_show', function( value ) { value.bind( function( to ) { - if( to != '' ) { + if( to !== '' ) { $( '#home-carousel' ).removeClass( 'zillah-only-customizer' ); } else { @@ -83,7 +83,7 @@ // Slider wp.customize( 'zillah_tags_show', function( value ) { value.bind( function( to ) { - if( to != '' ) { + if( to !== '' ) { $( '.tags-links' ).removeClass( 'zillah-only-customizer' ); } else { @@ -93,10 +93,10 @@ } ); // Social repeater - wp.customize( "zillah_social_icons", function( value ) { + wp.customize( 'zillah_social_icons', function( value ) { value.bind( function( to ) { var obj = JSON.parse( to ); - var result =""; + var result = ''; var lastIcon = $( '.social-media-icons li:last-child' ); @@ -104,7 +104,7 @@ result+= '
  • '; }); - if ( ! lastIcon.hasClass("zillah-only-customizer") ){ + if ( ! lastIcon.hasClass('zillah-only-customizer') ){ result+= '
  • '; } else { result+= '
  • '; @@ -117,7 +117,7 @@ // Page header image - wp.customize( "zillah_page_header", function( value ) { + wp.customize( 'zillah_page_header', function( value ) { value.bind( function( to ) { $('.page-main-header').css('background-image','url("'+ to +'")'); } ); @@ -127,7 +127,7 @@ // Sidebar wp.customize( 'zillah_sidebar_show', function( value ) { value.bind( function( to ) { - if( to != '' ) { + if( to !== '' ) { $( '#secondary' ).removeClass( 'zillah-only-customizer' ); $( '.content-area' ).addClass( 'content-area-with-sidebar' ); } diff --git a/js/functions.js b/js/functions.js index 91224b8..8d480fc 100644 --- a/js/functions.js +++ b/js/functions.js @@ -188,7 +188,7 @@ } $( document ).ready( function() { - $( window ).on( 'load.parallax-one', onResizeARIA ) + $( window ).on( 'load.parallax-one', onResizeARIA ); $( '#carousel-post-gallery' ).carousel({ @@ -230,7 +230,7 @@ $body.css( 'padding-top', window.innerWidth > 992 ? headerHeight : 0 ); }); - $(window).scroll(function (event) { + $(window).scroll(function () { var thisScrollTop = $(this).scrollTop(); changeDirection = ( thisScrollTop > headerHeight && (thisScrollTop > lastScrollTop && lastDirectionDown === false) || (thisScrollTop < lastScrollTop && lastDirectionDown === true) ? true : false ); if (changeDirection === true) { diff --git a/js/zillah-customizer.js b/js/zillah-customizer.js index 69da24b..1422014 100644 --- a/js/zillah-customizer.js +++ b/js/zillah-customizer.js @@ -23,11 +23,10 @@ jQuery(document).ready(function () { jQuery('.zillah_palette_input').html(metro_palette); - jQuery('.zillah_palette_input span').each(function (index) { + jQuery('.zillah_palette_input span').each(function () { it++; - var colnb = 'color' + it; var colval = jQuery(this).css('background-color'); - values["color" + it] = colval; + values['color' + it] = colval; }); th.parent().parent().find('.zillah_palette_colector').val(JSON.stringify(values)); th.parent().parent().find('.zillah_palette_colector').trigger('change'); From 42bae2f40dbb86a79dce213f85aa3f1a3a99f780 Mon Sep 17 00:00:00 2001 From: rodica-andronache Date: Tue, 21 Jun 2016 14:03:44 +0300 Subject: [PATCH 15/15] !!! Fixed issues reported by travis --- js/customizer.js | 2 -- js/functions.js | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/js/customizer.js b/js/customizer.js index b10cce2..be07cbb 100644 --- a/js/customizer.js +++ b/js/customizer.js @@ -110,8 +110,6 @@ result+= '
  • '; } $( '.social-media-icons' ).html( result ); - zillah_header_social_icons_width(); - zillah_menu_toggle_height(); } ); } ); diff --git a/js/functions.js b/js/functions.js index 8d480fc..3acd5aa 100644 --- a/js/functions.js +++ b/js/functions.js @@ -99,7 +99,10 @@ //ACCESSIBILITY MENU ( function( $ ) { + /* global screenReaderText */ + function initMainNavigation( container ) { + // Add dropdown toggle that display child menu items. container.find( '.menu-item-has-children > a' ).after( '' ); @@ -208,7 +211,7 @@ var headerHeight, isAdminBar, lastScrollTop = 0, - initTop = 0; + initTop = 0, changeDirection = false, lastDirectionDown = false; var $headerToHide = $( '.header-inner-top' ),