$out .= '</a>'; } } if ( $out ) { wp_enqueue_script( 'bxslider' ); //check whether this could be just like this or it needs a shortcode? echo '<div class="simple-slider" data-time="4000">' . $out . '</div>'; } } else { //no gallery? -> display featured image if ( is_single() && ! wm_option( 'blog-disable-featured-image' ) && ! wm_meta_option( 'disable-featured-image' ) ) echo wm_thumb( array( 'size' => 'content-width' ) ); elseif ( ! is_single() ) echo wm_thumb( array( 'size' => $imageSize ) ); } ?> </div> <div <?php post_class( 'article-content' ); ?>> <?php if ( ! is_single() ) wm_heading( 'list' ); ?> <?php if ( is_single() || wm_option( 'blog-full-posts' ) ) { if ( is_single() )
} //Remove the shortcode from content if ($media_shortcode) { $content = str_replace($media_shortcode, '', $content); } //Output media if ($media_shortcode) { echo do_shortcode($media_shortcode); } //If no video display featured image if (!$is_single && !$media_shortcode) { $image_size = apply_filters('wmhook_post_thumbnail_image_size', wm_option('skin-image-blog')); if (!$image_size) { $image_size = WM_DEFAULT_IMAGE_SIZE; } echo wm_thumb(array('attr-link' => wm_schema_org('image'), 'link' => get_permalink(), 'size' => $image_size)); } ?> </div> <?php } /** * Post title */ wm_post_title(); /** * Post content */ if ($is_single) { //Outputs full post content including excerpt at the top
function wm_shortcode_staff( $atts, $content = null ) { extract( shortcode_atts( array( 'align' => 'left', 'columns' => 4, 'count' => 4, 'department' => null, 'desc_size' => 4, 'order' => 'new', 'thumb' => true, ), $atts ) ); if ( 'disable' === wm_option( 'cp-role-staff' ) ) return; $out = ''; $imgSize = ( wm_option( 'general-staff-image-ratio' ) ) ? ( 'mobile-' . wm_option( 'general-staff-image-ratio' ) ) : ( 'mobile-ratio-169' ); //validation $align = ( 'right' === trim( $align ) ) ? ( trim( $align ) ) : ( 'left' ); $cols = ( 0 < absint( $columns ) && 7 > absint( $columns ) ) ? ( absint( $columns ) ) : ( 4 ); $colsDesc = ( 1 < absint( $desc_size ) && 7 > absint( $desc_size ) ) ? ( absint( $desc_size ) ) : ( 4 ); $count = ( $count ) ? ( absint( $count ) ) : ( 4 ); $orderMethod = array( 'all' => array( 'new', 'old', 'name', 'random' ), 'new' => array( 'date', 'DESC' ), 'old' => array( 'date', 'ASC' ), 'name' => array( 'title', 'ASC' ), 'random' => array( 'rand', '' ) ); $order = ( in_array( trim( $order ), $orderMethod['all'] ) ) ? ( $orderMethod[trim( $order )] ) : ( $orderMethod['new'] ); $thumb = ( $thumb ) ? ( ' has-thumbs' ) : ( false ); if ( $department ) if ( is_numeric( $department ) ) { $department = absint( $department ); } else { $department = get_term_by( 'slug', sanitize_title( $department ), 'department' ); $department = ( $department && isset( $department->term_id ) ) ? ( $department->term_id ) : ( null ); } else $department = null; //get the staff wp_reset_query(); $queryArgs = array( 'post_type' => 'wm_staff', 'posts_per_page' => $count, 'ignore_sticky_posts' => 1, 'orderby' => $order[0], 'order' => $order[1] ); if ( 0 < $department ) $queryArgs['tax_query'] = array( array( 'taxonomy' => 'department', 'field' => 'id', 'terms' => explode( ',', $department ) ) ); $staff = new WP_Query( $queryArgs ); if ( $staff->have_posts() ) { $i = $row = 0; $out .= '<div class="wrap-staff-shortcode clearfix apply-top-margin' . $thumb . '">'; if ( $content ) { //if description (shortcode content) $out .= ( 'right' === $align ) ? ( '<div class="column col-' . ( $colsDesc - 1 ) . $colsDesc . '"><div class="wrap-staff"><div class="row">' ) : ( '<div class="column col-1' . $colsDesc . ' wrap-description">' . do_shortcode( $content ) . '</div><div class="column col-' . ( $colsDesc - 1 ) . $colsDesc . ' last"><div class="wrap-staff"><div class="row">' ); //if description on the right - open staff container and inner container only ELSE output content column and open staff container } else { //if no description (no shortcode content) $out .= '<div class="wrap-staff"><div class="row">'; } while ( $staff->have_posts() ) : //output post content $staff->the_post(); if ( wm_option( 'cp-staff-rich' ) ) $excerptText = ( has_excerpt() ) ? ( apply_filters( 'wm_default_content_filters', get_the_excerpt() ) ) : ( '' ); else $excerptText = apply_filters( 'wm_default_content_filters', get_the_content() ); $contacts = ''; if ( wm_meta_option( 'staff-phone' ) ) $contacts .= '<li class="staff-phone">' . wm_meta_option( 'staff-phone' ) . '</li>'; if ( wm_meta_option( 'staff-email' ) ) $contacts .= '<li class="staff-email"><a href="#" data-address="' . wm_nospam( wm_meta_option( 'staff-email' ) ) . '" class="email-nospam">' . wm_nospam( wm_meta_option( 'staff-email' ) ) . '</a></li>'; if ( wm_meta_option( 'staff-linkedin' ) ) $contacts .= '<li class="staff-linkedin"><a href="' . esc_url( wm_meta_option( 'staff-linkedin' ) ) . '" target="_blank">' . get_the_title() . '</a></li>'; if ( wm_meta_option( 'staff-skype' ) ) $contacts .= '<li class="staff-skype"><a href="skype:' . sanitize_title( wm_meta_option( 'staff-skype' ) ) . '?call">' . wm_meta_option( 'staff-skype' ) . '</a></li>'; if ( is_array( wm_meta_option( 'staff-custom-contacts' ) ) ) { foreach ( wm_meta_option( 'staff-custom-contacts' ) as $contact ) { $contacts .= '<li class="' . $contact['attr'] . '">' . strip_tags( trim( $contact['val'] ), '<a><img><strong><span><small><em><b><i>' ) . '</li>'; } } $excerptText .= ( $contacts ) ? ( '<ul>' . $contacts . '</ul>' ) : ( '' ); $staffOutput = array( 'thumb' => wm_thumb( array( 'class' => 'staff-thumb', 'size' => $imgSize, 'list' => true, 'link' => 'modal', 'placeholder' => true, 'overlay' => __( 'Zoom', 'lespaul_domain' ), ) ), 'thumb-permalink' => wm_thumb( array( 'class' => 'staff-thumb', 'size' => $imgSize, 'list' => true, 'placeholder' => true, 'overlay' => __( 'Read more', 'lespaul_domain' ), ) ), 'title' => '<h3 class="staff-title text-element"><strong>' . get_the_title() . '</strong></h3>', 'title-link' => '<h3 class="staff-title text-element"><a href="' . get_permalink() . '"><strong>' . get_the_title() . '</strong></a></h3>', 'position' => '<p class="staff-position text-element">' . wm_meta_option( 'staff-position' ) . '</p>', 'excerpt' => $excerptText ); $row = ( ++$i % $cols === 1 ) ? ( $row + 1 ) : ( $row ); $out .= ( $i % $cols === 1 && 1 < $row ) ? ( '</div><div class="row">' ) : ( '' ); $out .= '<article class="column col-1' . $cols . ' no-margin">'; if ( $thumb ) $out .= ( wm_option( 'cp-staff-rich' ) && ! wm_meta_option( 'staff-no-rich' ) ) ? ( $staffOutput['thumb-permalink'] ) : ( $staffOutput['thumb'] ); $out .= '<div class="text">'; $out .= ( wm_option( 'cp-staff-rich' ) && ! wm_meta_option( 'staff-no-rich' ) ) ? ( $staffOutput['title-link'] ) : ( $staffOutput['title'] ); $out .= $staffOutput['position']; $out .= '<div class="staff-excerpt text-element">' . $staffOutput['excerpt'] . '</div>'; $out .= '</div>'; $out .= '</article>'; endwhile; if ( $content ) { //if description (shortcode content) $out .= ( 'right' === $align ) ? ( '</div></div></div><div class="column col-1' . $colsDesc . ' last wrap-description">' . do_shortcode( $content ) . '</div>' ) : ( '</div></div></div>' ); //if description on the right - close staff container and its inner container and output content column ELSE just close staff container and its inner container } else { //if no description (no shortcode content) $out .= '</div></div>'; } $out .= '</div>'; } wp_reset_query(); return $out; }
* @subpackage Post Formats * @copyright 2014 WebMan - Oliver Juhas */ ?> <article id="post-<?php the_ID(); ?> " <?php post_class(); echo wm_schema_org('article'); ?> > <?php wm_post_title(false); wmhook_entry_top(); //Featured image if (has_post_thumbnail()) { $image_size = apply_filters('wmhook_quote_post_thumbnail_image_size', 'admin-thumbnail'); echo '<div class="quote-container has-thumbnail">'; echo wm_thumb(array('attr-link' => wm_schema_org('image'), 'link' => '', 'size' => $image_size)); } else { echo '<div class="quote-container">'; } echo apply_filters('wmhook_content_filters', get_the_content()); echo '</div>'; wmhook_entry_bottom(); ?> </article>
if ( wm_meta_option( 'staff-phone' ) ) $out .= '<li class="staff-phone" title="' . __( 'Phone', 'lespaul_domain_adm' ) . '"><strong>' . __( 'Phone', 'lespaul_domain_adm' ) . ': </strong>' . wm_meta_option( 'staff-phone' ) . '</li>'; if ( wm_meta_option( 'staff-email' ) ) $out .= '<li class="staff-email" title="' . __( 'Email', 'lespaul_domain_adm' ) . '"><strong>' . __( 'Email', 'lespaul_domain_adm' ) . ': </strong><a href="#" data-address="' . wm_nospam( wm_meta_option( 'staff-email' ) ) . '" class="email-nospam">' . wm_nospam( wm_meta_option( 'staff-email' ) ) . '</a></li>'; if ( wm_meta_option( 'staff-linkedin' ) ) $out .= '<li class="staff-linkedin" title="' . __( 'LinkedIn', 'lespaul_domain_adm' ) . '"><strong>' . __( 'LinkedIn', 'lespaul_domain_adm' ) . ': </strong><a href="' . esc_url( wm_meta_option( 'staff-linkedin' ) ) . '" target="_blank">' . get_the_title() . '</a></li>'; if ( wm_meta_option( 'staff-skype' ) ) $out .= '<li class="staff-skype" title="' . __( 'Skype', 'lespaul_domain_adm' ) . '"><strong>' . __( 'Skype', 'lespaul_domain_adm' ) . ': </strong><a href="skype:' . sanitize_title( wm_meta_option( 'staff-skype' ) ) . '?call">' . wm_meta_option( 'staff-skype' ) . '</a></li>'; if ( is_array( wm_meta_option( 'staff-custom-contacts' ) ) ) { foreach ( wm_meta_option( 'staff-custom-contacts' ) as $contact ) { $out .= '<li class="' . $contact['attr'] . '">' . strip_tags( trim( $contact['val'] ), '<a><img><strong><span><small><em><b><i>' ) . '</li>'; } } if ( $out ) echo '<div class="staff-card alignleft">' . wm_thumb( array( 'size' => 'mobile' ) ) . '<ul>' . $out . '</ul></div>'; ?> <?php if ( is_single() ) { the_content(); } else { wm_content_or_excerpt( $post ); } ?> </div> <?php wp_reset_query(); do_action( 'wm_after_post' ); endif; ?>
} else { $posts_images = wm_get_post_images(); foreach ($posts_images as $image) { $images[] = $image['id']; } } if (is_array($images) && !empty($images)) { echo do_shortcode(apply_filters('wmhook_post_format_gallery_slideshow_shortcode', '[wm_slideshow ids="' . implode(',', $images) . '" nav="pagination" size="' . $image_size . '" speed="4000" /]')); } } } //If no gallery, display featured image (also, always display featured image on single post page) if ($is_single && !apply_filters('wmhook_disable_single_featured_image', false) && !(function_exists('wma_meta_option') && wma_meta_option('disable-featured-image')) && !$pagination_suffix) { echo wm_thumb(array('attr-link' => wm_schema_org('image'), 'class' => 'image-container post-thumbnail scale-rotate', 'link' => 'bigimage', 'size' => 'content-width')); } elseif (!$is_single && (!$media_shortcode[0] || !function_exists('wma_amplifier'))) { echo wm_thumb(array('attr-link' => wm_schema_org('image'), 'class' => 'image-container post-thumbnail scale-rotate', 'link' => get_permalink(), 'size' => $image_size)); } ?> </div> <?php /** * Post title */ wm_post_title(); /** * Post content */ if ($is_single) { //Outputs full post content including excerpt at the top wmhook_entry_top();
?> > <?php /** * Post media */ if (has_post_thumbnail() && !$pagination_suffix) { $image_size = apply_filters('wmhook_post_thumbnail_image_size', wm_option('skin-image-blog')); if (!$image_size) { $image_size = WM_DEFAULT_IMAGE_SIZE; } if ($is_single && !apply_filters('wmhook_disable_single_featured_image', false) && !(function_exists('wma_meta_option') && wma_meta_option('disable-featured-image'))) { echo '<div class="post-media"' . wm_schema_org('image') . '>' . wm_thumb(array('class' => 'image-container post-thumbnail scale-rotate', 'link' => 'bigimage', 'size' => 'content-width')) . '</div>'; } elseif (!$is_single) { echo '<div class="post-media"' . wm_schema_org('image') . '>' . wm_thumb(array('class' => 'image-container post-thumbnail scale-rotate', 'link' => get_permalink(), 'size' => $image_size)) . '</div>'; } } /** * Post title */ wm_post_title(); /** * Post content */ if ($is_single) { //Outputs full post content including excerpt at the top wmhook_entry_top(); if (has_excerpt() && !$pagination_suffix && !wm_option('blog-disable-single-post-excerpt')) { echo wm_excerpt(); }
global $blogLayout; $mediaClasses = ''; if ( in_array( $blogLayout, array( ' media-left', ' media-right', ' zigzag' ) ) ) { $imageSize = ( wm_option( 'general-post-image-ratio-alt' ) ) ? ( 'mobile-' . wm_option( 'general-post-image-ratio-alt' ) ) : ( 'mobile-ratio-169' ); $mediaClasses = ' frame'; } elseif ( ' masonry-container' == $blogLayout ) { $imageSize = ( wm_option( 'general-post-image-ratio' ) ) ? ( 'mobile-' . wm_option( 'general-post-image-ratio' ) ) : ( 'mobile-ratio-169' ); } else { $imageSize = ( wm_option( 'general-post-image-ratio' ) ) ? ( wm_option( 'general-post-image-ratio' ) ) : ( 'ratio-169' ); } if ( is_single() && ! wm_option( 'blog-disable-featured-image' ) && ! wm_meta_option( 'disable-featured-image' ) ) echo '<div class="post-media' . $mediaClasses . '">' . wm_thumb( array( 'size' => 'content-width' ) ) . '</div>' . "\r\n\r\n"; elseif ( ! is_single() ) echo '<div class="post-media' . $mediaClasses . '">' . wm_thumb( array( 'size' => $imageSize, 'link' => get_permalink() ) ) . '</div>' . "\r\n\r\n"; } ?> <div <?php post_class( 'article-content' ); ?>> <?php if ( ! is_single() ) wm_heading( 'list' ); ?> <?php if ( is_single() || wm_option( 'blog-full-posts' ) ) { if ( is_single() ) wm_meta(); if ( has_excerpt() && ! post_password_required() ) echo '<div class="article-excerpt">' . apply_filters( 'wm_default_content_filters', get_the_excerpt() ) . '</div>';