From: Laury GvR Date: Mon, 7 Aug 2017 13:25:22 +0000 (-0400) Subject: Featured image GLM style, order subsections,etc X-Git-Tag: v1.0.0^2~2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=db161928bdf03c46b26ed91019ce167cc3e16ed4;p=WP-Themes%2Fcharlevoixdesign2017.git Featured image GLM style, order subsections,etc - Featured image : now retrieved from Featured image set for home page in admin. - Featured image : gut the current implementation and use what we always do on our other themes (glm_get_header) with some edits. - Subections are now ordered by menu order - Clicking the active tab no longer hides its content. --- diff --git a/assets/images/cropped-header.jpg b/assets/images/cropped-header.jpg new file mode 100644 index 0000000..ead14fa Binary files /dev/null and b/assets/images/cropped-header.jpg differ diff --git a/assets/js/global.js b/assets/js/global.js index dec6e62..a7b54d1 100755 --- a/assets/js/global.js +++ b/assets/js/global.js @@ -198,13 +198,15 @@ } target = $(this).attr('id').split("-")[1]; parent_target = $(this).parents('.parent-container').attr('id').split("-")[1]; - $('#nav-'+parent_target+' .page-nav-container li').removeClass("active"); - $(this).parents('.page-nav-container li').toggleClass("active"); + if ( !$(this).parents('.page-nav-container li').hasClass("active") ) { + $('#nav-'+parent_target+' .page-nav-container li').removeClass("active"); + $(this).parents('.page-nav-container li').toggleClass("active"); + //alert("test"); + // alert(parent_target); + $('#content-'+parent_target+' .page-content-container article:not(#page-'+target+')').addClass('inactive').removeClass('active'); + $('#content-'+parent_target+' .page-content-container #page-'+target).toggleClass('inactive').toggleClass('active'); - //alert("test"); -// alert(parent_target); - $('#content-'+parent_target+' .page-content-container article:not(#page-'+target+')').addClass('inactive').removeClass('active'); - $('#content-'+parent_target+' .page-content-container #page-'+target).toggleClass('inactive').toggleClass('active'); + } }); // If navigation menu is present on page, setNavProps and adjustScrollClass. // if ( $navigation.length ) { diff --git a/assets/js/navigation.js b/assets/js/navigation.js index 101cefa..c85f414 100755 --- a/assets/js/navigation.js +++ b/assets/js/navigation.js @@ -149,12 +149,14 @@ function setActiveNavItem() { console.log("here"); $(".nav-parent").each(function() { - if(myTopPosition > $(this).offset().top && ( $(this).offset().top + $(this).next().outerHeight() > myTopPosition-90) ) { - - $('.top-nav-right-list a[href="#' + $(this).attr("id") +'"]').addClass("active"); - } else { - //console.log("no"); - $('.top-nav-right-list a[href="#' + $(this).attr("id") +'"]').removeClass("active"); + if ( $('.top-nav-right-list a[href="#' + $(this).attr("id") +'"]').not(".active") ) { + if(myTopPosition > $(this).offset().top && ( $(this).offset().top + $(this).next().outerHeight() > myTopPosition-90) ) { + + $('.top-nav-right-list a[href="#' + $(this).attr("id") +'"]').addClass("active"); + } else { + //console.log("no"); + $('.top-nav-right-list a[href="#' + $(this).attr("id") +'"]').removeClass("active"); + } } }); } diff --git a/front-page.php b/front-page.php index a3b3d3a..30bf473 100755 --- a/front-page.php +++ b/front-page.php @@ -38,7 +38,7 @@ get_header(); ?> $parent_args = array( 'posts_per_page' => 0, 'offset' => 0, - 'orderby' => 'order', + 'orderby' => 'menu_order', 'order' => 'ASC', 'post_type' => 'page', 'post_parent' => '0', @@ -61,7 +61,7 @@ get_header(); ?> $child_args = array( 'posts_per_page' => 0, 'offset' => 0, - 'orderby' => 'order', + 'orderby' => 'menu_order', 'order' => 'ASC', 'post_type' => 'page', 'post_parent' => $a_parent->ID, diff --git a/functions.php b/functions.php index af3001c..59ad81a 100755 --- a/functions.php +++ b/functions.php @@ -284,6 +284,20 @@ function twentyseventeen_fonts_url() { return esc_url_raw( $fonts_url ); } +/** + * Function for getting the header. + */ +function glm_get_header() { + if (has_post_thumbnail()) { + $image_data = wp_get_attachment_image_src(get_post_thumbnail_id(), "full"); + + echo ' '; + + } else { + echo ' '; + } +} + /** * Add preconnect for Google Fonts. * diff --git a/header.php b/header.php index 8e9a68f..c9323ae 100755 --- a/header.php +++ b/header.php @@ -66,11 +66,12 @@
- - +
+ +
'; - endif; - ?> -
diff --git a/index.php b/index.php index d21a560..ce98d15 100755 --- a/index.php +++ b/index.php @@ -34,8 +34,6 @@ get_header(); ?>
> - ID ), 'twentyseventeen-featured-image' ); - - $post_thumbnail_id = get_post_thumbnail_id( $post->ID ); - - $thumbnail_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'twentyseventeen-featured-image' ); - - // Calculate aspect ratio: h / w * 100%. - $ratio = $thumbnail_attributes[2] / $thumbnail_attributes[1] * 100; - ?> - -
-
-
- - -