function wm_heading( $list = null, $wrap = null ) { if ( is_page_template( 'page-template/construction.php' ) || is_404() ) return; global $post, $page, $paged, $wp_query; if ( ! isset( $paged ) ) $paged = 0; if ( ! isset( $page ) ) $page = 0; $shopPageId = ( class_exists( 'Woocommerce' ) && is_shop() && function_exists( 'woocommerce_get_page_id' ) ) ? ( woocommerce_get_page_id( 'shop' ) ) : ( null ); $authorInfo = ''; $blogPageId = ( is_home() ) ? ( get_option( 'page_for_posts' ) ) : ( null ); $subheading = ( ! is_archive() ) ? ( wm_meta_option( 'subheading', $blogPageId ) ) : ( '' ); $headingAlign = wm_meta_option( 'main-heading-alignment', $blogPageId ); if ( is_search() && ! is_home() && ! class_exists( 'Woocommerce' ) ) $subheading = sprintf( __( 'Number of items found: %s', 'lespaul_domain' ), $wp_query->found_posts ); if ( is_author() && 2 > $paged ) { $userID = $wp_query->query_vars['author']; $authorDescription = get_the_author_meta( 'description', $userID ); if ( $authorDescription ) { $authorDescription = '<div class="desc">' . $authorDescription . '</div>'; $authorWebsite = ( get_the_author_meta( 'user_url', $userID ) ) ? ( '<div class="website"><a href="' . esc_url( get_the_author_meta( 'user_url', $userID ) ) . '">' . __( "Visit author's website", 'lespaul_domain' ) . '</a></div>' ) : ( '' ); $authorAvatar = get_avatar( $userID, 180 ); $authorName = get_the_author_meta( 'display_name', $userID ); $authorSocial = array(); if ( get_the_author_meta( 'facebook', $userID ) ) $authorSocial[] = '[social url="' . esc_url( get_the_author_meta( 'facebook', $userID ) ) . '" icon="Facebook" title="' . sprintf( __( '%s on Facebook', 'lespaul_domain' ), $authorName ) . '" size="m"]'; if ( get_the_author_meta( 'googleplus', $userID ) ) $authorSocial[] = '[social url="' . esc_url( get_the_author_meta( 'googleplus', $userID ) ) . '" icon="Google+" title="' . sprintf( __( '%s on Google+', 'lespaul_domain' ), $authorName ) . '" size="m" rel="me"]'; if ( get_the_author_meta( 'twitter', $userID ) ) $authorSocial[] = '[social url="' . esc_url( get_the_author_meta( 'twitter', $userID ) ) . '" icon="Twitter" title="' . sprintf( __( '%s on Twitter', 'lespaul_domain' ), $authorName ) . '" size="m"]'; $authorSocial = ( ! empty( $authorSocial ) ) ? ( '<div class="socials">' . implode( ' ', $authorSocial ) . '</div>' ) : ( '' ); $authorInfo = apply_filters( 'wm_default_content_filters', $authorAvatar . $authorDescription . $authorWebsite . $authorSocial ); } } if ( is_attachment() && ! empty( $post->post_parent ) ) $subheading = '<a href="' . get_permalink( $post->post_parent ) . '" title="' . esc_attr( sprintf( __( 'Return to %s', 'lespaul_domain' ), strip_tags( get_the_title( $post->post_parent ) ) ) ) . '">« ' . get_the_title( $post->post_parent ) . '</a>'; //List title if ( isset( $list ) && $list ) { $out = ''; if ( has_post_format( 'status' ) ) $out .= ( get_the_title() ) ? ( get_the_title() ) : ( '' ); else $out .= ( get_the_title() ) ? ( '<a href="' . get_permalink() . '">' . get_the_title() . '</a>' ) : ( '' ); $titleSticky = ''; if ( is_sticky() ) $titleSticky = ' title="' . __( 'This is featured post', 'lespaul_domain' ) . '"'; $output = ( $out ) ? ( '<h2 class="post-title"' . $titleSticky . '>' . $out . '</h2>' ) : ( '' ); //output echo $output; return; } //Main H1 title $out = ''; if ( is_singular() || $blogPageId ) { //post or page $title = ( isset( $wrap ) && $wrap ) ? ( '<' . $wrap . '>' . get_the_title( $blogPageId ) . '</' . $wrap . '>' ) : ( get_the_title( $blogPageId ) ); if ( 1 < $page ) $out .= ( $title ) ? ( '<a href="' . get_permalink() . '">' . $title . '</a> <small>(part ' . $page . ')</small>' ) : ( '' ); else $out .= ( $title ) ? ( $title ) : ( '' ); } elseif ( is_day() ) { //dayly archives $out .= sprintf( __( '<span>Daily Archives: </span>%s', 'lespaul_domain' ), get_the_date() ); } elseif ( is_month() ) { //monthly archives $out .= sprintf( __( '<span>Monthly Archives: </span>%s', 'lespaul_domain' ), get_the_date( 'F Y' ) ); } elseif ( is_year() ) { //yearly archives $out .= sprintf( __( '<span>Yearly Archives: </span>%s', 'lespaul_domain' ), get_the_date( 'Y' ) ); } elseif ( is_author() ) { //author archive $userID = $wp_query->query_vars['author']; $out .= sprintf( __( '<span>Posts by </span>%s', 'lespaul_domain' ), get_the_author_meta( 'display_name', $userID ) ); } elseif ( is_category() ) { //category archive $out .= sprintf( __( '<span>Posts in </span>%s', 'lespaul_domain' ), single_cat_title( '', false ) ); } elseif ( is_tag() ) { //tag archive $out .= sprintf( __( '<span>Posts Tagged as </span>%s', 'lespaul_domain' ), single_tag_title( '', false ) ); } elseif ( is_search() ) { //search $out .= sprintf( __( '<span>Search results for </span>%s', 'lespaul_domain' ), get_search_query() ); } elseif ( is_tax( 'project-category' ) ) { //custom taxonomy $portfolioPage = wm_option( 'general-breadcrumbs-portfolio-page' ); $portfolioPageID = wm_page_slug_to_id( $portfolioPage ); $portfolioPage = ( $portfolioPageID ) ? ( get_the_title( $portfolioPageID ) . ' / ' ) : ( '' ); $out .= $portfolioPage . $wp_query->queried_object->name; } else { //other situations $out .= ( wm_option( 'pages-default-archives-title' ) ) ? ( wm_option( 'pages-default-archives-title' ) ) : ( '' ); } //WooCommerce titles if ( class_exists( 'Woocommerce' ) && ! $out ) { global $shop_page_title; $shop_page = get_post( woocommerce_get_page_id( 'shop' ) ); $out = apply_filters( 'the_title', ( $shop_page_title = get_option( 'woocommerce_shop_page_title' ) ) ? $shop_page_title : $shop_page->post_title ); } //paged $out .= ( 1 < $paged ) ? ( ' <small>(page ' . $paged . ')</small>' ) : ( '' ); //post, page title and subtitle display $class = $classContainer = ''; if ( wm_meta_option( 'no-heading', $blogPageId ) || ! $out ) { $class = ( ( is_singular() || is_home() ) && $subheading ) ? ( 'invisible' ) : ( '' ); $classContainer .= ( ( is_singular() || is_home() ) && ! $subheading ) ? ( ' invisible' ) : ( ' visible' ); } else { $classContainer .= ' visible'; } if ( $shopPageId ) { $subheading = wm_meta_option( 'subheading', $shopPageId ); if ( wm_meta_option( 'no-heading', $shopPageId ) ) { $class = ( $subheading ) ? ( 'invisible' ) : ( '' ); $classContainer .= ( ! $subheading ) ? ( ' invisible' ) : ( ' visible' ); } $headingAlign = wm_meta_option( 'main-heading-alignment', $shopPageId ); } $subtitleH2 = ( $subheading ) ? ( '<h2 class="subtitle">' . do_shortcode( $subheading ) . '</h2>' ) : ( '' ); $subtitleH2 = ( $authorInfo ) ? ( '<div class="authorinfo">' . $authorInfo . '</div>' ) : ( $subtitleH2 ); $classContainer .= ( $subtitleH2 ) ? ( ' has-subtitle' ) : ( '' ); $wrapper = $wrapperEnd = ''; //main heading background color class $classContainer .= ( wm_css_background( 'design-main-heading-' ) ) ? ( ' set-bg' ) : ( '' ); $classContainer .= ( $headingAlign ) ? ( ' text-' . $headingAlign ) : ( ' text-' . wm_option( 'design-main-heading-alignment' ) ); //icon if ( ! wm_meta_option( 'main-heading-icon', $blogPageId ) || is_archive() || is_search() ) { $headingIcon = ''; } else { $headingIcon = '<i class="' . wm_meta_option( 'main-heading-icon', $blogPageId ) . '"></i>'; $classContainer .= ' has-icon'; } if ( $shopPageId ) { $headingIcon = '<i class="' . wm_meta_option( 'main-heading-icon', $shopPageId ) . '"></i>'; $classContainer .= ' has-icon'; } //wrapper width $classContainer .= wm_element_width( 'mainheading' ); //CSS3 animations $classContainer .= ( ! wm_option( 'design-no-animation-heading' ) ) ? ( ' animated' ) : ( '' ); $before = '<header id="main-heading" class="main-heading wrap clearfix' . $classContainer . '"><div class="no-overflow"><div class="wrap-inner"><div class="twelve pane">'; $after = '</div></div></div></header>'; $mainHeadingTag = ( ! is_front_page() ) ? ( '1' ) : ( '2' ); if ( is_front_page() ) $class .= ' h1-style'; if ( $class ) $class = ' class="' . trim( $class ) . '"'; //output echo $before . $wrapper . $headingIcon . '<h' . $mainHeadingTag . $class . '>' . $out . '</h' . $mainHeadingTag . '>' . $subtitleH2 . $wrapperEnd . $after; }
$aboveFooter = null; //WooCommerce pages if ( class_exists( 'Woocommerce' ) && is_woocommerce() ) $aboveFooter = null; if ( $aboveFooter && is_active_sidebar( $aboveFooter ) && ! wm_meta_option( 'no-above-footer-widgets', $pageId ) ) { echo '<section id="above-footer" class="wrap clearfix above-footer-widgets-wrap' . wm_element_width( 'abovefooter' ) . '"><div class="wrap-inner">'; wm_sidebar( $aboveFooter, 'widgets columns twelve pane', 5 ); //no restriction echo '</div></section>'; } ?> <?php do_action( 'wm_before_footer' ); ?> <footer id="footer" class="wrap clearfix footer<?php echo wm_element_width( 'footer' ); ?>"> <!-- FOOTER --> <?php if ( $footerRow && is_active_sidebar( $footerRow ) ) { echo '<section class="footer-widgets-wrap first"><div class="wrap-inner">'; wm_sidebar( $footerRow, 'widgets columns twelve pane', 5 ); //restricted to 5 widgets echo '</div></section>'; } ?> <section class="bottom-wrap clearfix"><div class="wrap-inner"> <div class="twelve pane"> <?php if ( is_page_template( 'page-template/landing.php' ) ) $menuLocationName = 'menu-landing-page-' . get_the_ID(); else
); $headerText = strtr( $headerText, $replaceArray ); if ( $headerText ) echo '<div class="header-side"><a class="invisible" href="#nav-main">' . __( 'Go to main navigation', 'lespaul_domain' ) . '</a><div class="header-side-content">' . apply_filters( 'wm_default_content_filters', $headerText ) . '</div></div>'; } else { if ( ' nav-bottom logo-centered' !== wm_option( 'header-navigation-position' ) ) get_template_part( 'nav' ); } ?> </div> </div> <!-- /wrap-inner --> <?php if ( ! is_page_template( 'page-template/construction.php' ) && in_array( wm_option( 'header-navigation-position' ), array( ' nav-bottom', ' nav-bottom logo-centered' ) ) ) //display only when bottom navigation header layout used and not Under construction template get_template_part( 'nav' ); ?> </div><!-- /header --></header> <?php do_action( 'wm_after_header' ); ?> <div id="content" class="wrap clearfix content<?php echo wm_element_width( 'content' ); ?>"> <!-- CONTENT --> <?php do_action( 'wm_before_main_content' ); ?>