<p class="pm-staff-item-name"><?php the_title(); ?> </p> <p class="pm-staff-item-title"><?php echo $pm_staff_title_meta; ?> </p> <div class="pm-divider"></div> <p class="pm-staff-item-excerpt"> <?php $excerpt = get_the_excerpt(); echo pm_ln_string_limit_words($excerpt, 20) . '...'; ?> </p> <div class="pm-divider"></div> <ul class="pm-staff-social-icons"> <?php if ($pm_staff_twitter_meta !== '') { echo '<li><a href="' . $pm_staff_twitter_meta . '" class="fa fa-twitter" target="_blank"></a></li>'; } if ($pm_staff_facebook_meta !== '') { echo '<li><a href="' . $pm_staff_facebook_meta . '" class="fa fa-facebook" target="_blank"></a></li>'; } if ($pm_staff_linkedin_meta !== '') { echo '<li><a href="' . $pm_staff_linkedin_meta . '" class="fa fa-linkedin" target="_blank"></a></li>';
function widget($args, $instance) { extract($args); echo $before_widget; $title = apply_filters('widget_title', $instance['title']); $fa_icon = '<i class="' . (empty($instance['fa_icon']) ? '' : $instance['fa_icon']) . ' pm-sidebar-icon"></i> '; $numOfPosts = empty($instance['numOfPosts']) ? '3' : $instance['numOfPosts']; if (!empty($title)) { echo $before_title . $title . $after_title; } //end of if /* post_author post_date post_date_gmt post_content post_title post_category post_excerpt post_status comment_status ping_status post_name comment_count */ //retrieve recent posts $args = array('numberposts' => $numOfPosts, 'offset' => 0, 'category' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'post_event', 'post_status' => 'publish', 'suppress_filters' => true); $recent_posts = wp_get_recent_posts($args, ARRAY_A); echo '<ul class="pm-event-widget-ul">'; //front-end widget code here foreach ($recent_posts as $recent) { $pm_event_featured_image_meta = get_post_meta($recent["ID"], 'pm_event_featured_image_meta', true); $pm_event_date_meta = get_post_meta($recent["ID"], 'pm_event_date_meta', true); $month = date("M", strtotime($pm_event_date_meta)); $day = date("d", strtotime($pm_event_date_meta)); $year = date("Y", strtotime($pm_event_date_meta)); $pm_event_fan_page_meta = get_post_meta($recent["ID"], 'pm_event_fan_page_meta', true); $excerpt = $recent['post_excerpt']; echo '<li>'; echo '<div class="pm-event-widget-container">'; echo '<div class="pm-event-widget-img" style="background-image:url(' . $pm_event_featured_image_meta . ');">'; echo '<div class="pm-event-widget-date-container">'; echo '<p class="pm-event-widget-month">' . $month . '</p>'; echo '<p class="pm-event-widget-day">' . $day . '</p>'; echo '</div>'; echo '</div>'; echo '<div class="pm-event-widget-desc">'; echo '<p class="pm-event-widget-desc-title">' . $recent['post_title'] . '</p>'; echo '<p class="pm-event-widget-desc-excerpt">' . pm_ln_string_limit_words($excerpt, 20) . '<a href="' . $recent['guid'] . '"> {...}</a> </p>'; echo '</div>'; echo '<ul class="pm-event-widget-btns">'; echo '<li><a href="' . $recent['guid'] . '" class="pm-rounded-btn small">' . __('More Info', 'viennatheme') . '</a></li>'; echo '<li><a href="' . $pm_event_fan_page_meta . '" class="pm-rounded-btn small event-fan-page"><i class="fa fa-facebook"></i> ' . __('Fan Page', 'viennatheme') . '</a></li>'; echo '</ul>'; echo '</div>'; echo '</li>'; } //end of foreach echo '</ul>'; echo $after_widget; }
" class="fa fa-facebook" target="_blank"></a> </li> <?php $postExcerpt = get_the_excerpt(); ?> <li class="<?php echo $enableTooltip == 'on' ? 'pm_tip_static_top' : ''; ?> " <?php echo $enableTooltip == 'on' ? 'title="' . __('Share on Linkedin', 'viennatheme') . '"' : ''; ?> > <a href="http://www.linkedin.com/shareArticle?mini=true&url=<?php echo urlencode(site_url()); ?> &title=<?php echo urlencode(get_the_title()); ?> &summary=<?php echo urlencode(pm_ln_string_limit_words($postExcerpt, 30)); ?> &source=<?php echo urlencode(site_url()); ?> " title="<?php _e('Share on LinkedIn', 'localization'); ?> " class="fa fa-linkedin" target="_blank"></a> </li> </ul> </div>
function staffProfile($atts, $content = null) { extract(shortcode_atts(array("id" => '', "name_color" => '#2C5E83', "title_color" => '#4B4B4B', "text_color" => '#4b4b4b', "icon_color" => '#dad9d9', "target" => '_blank', "class" => 'wow fadeInUp', "animation_delay" => 2), $atts)); //Method to retrieve a single post $queried_post = get_post($id); $postID = $queried_post->ID; $postLink = $queried_post->guid; $postTitle = $queried_post->post_title; //$postTags = get_the_tags($postID); $postExcerpt = $queried_post->post_excerpt; $shortExcerpt = pm_ln_string_limit_words($postExcerpt, 20); $pm_staff_image_meta = get_post_meta($postID, 'pm_staff_image_meta', true); $pm_staff_title_meta = get_post_meta($postID, 'pm_staff_title_meta', true); $pm_staff_twitter_meta = get_post_meta($postID, 'pm_staff_twitter_meta', true); $pm_staff_facebook_meta = get_post_meta($postID, 'pm_staff_facebook_meta', true); $pm_staff_gplus_meta = get_post_meta($postID, 'pm_staff_gplus_meta', true); $pm_staff_linkedin_meta = get_post_meta($postID, 'pm_staff_linkedin_meta', true); $html = ''; $html .= '<div class="pm-staff-profile-container ' . $class . '" data-wow-delay="0.' . $animation_delay . 's" data-wow-offset="50" data-wow-duration="1s">'; $html .= '<div class="pm-staff-profile-image-wrapper">'; $html .= '<div class="pm-staff-profile-image">'; $html .= '<img src="' . $pm_staff_image_meta . '" class="img-responsive" alt="profile">'; $html .= '</div>'; $html .= '<ul class="pm-staff-profile-icons">'; if ($pm_staff_twitter_meta !== '') { $html .= '<li><a href="' . $pm_staff_twitter_meta . '" target="' . $target . '" style="background-color:' . $icon_color . ';"><i class="fa fa-twitter"></i></a></li>'; } if ($pm_staff_facebook_meta !== '') { $html .= '<li><a href="' . $pm_staff_facebook_meta . '" target="' . $target . '" style="background-color:' . $icon_color . ';"><i class="fa fa-facebook"></i></a></li>'; } if ($pm_staff_gplus_meta !== '') { $html .= '<li><a href="' . $pm_staff_gplus_meta . '" target="' . $target . '" style="background-color:' . $icon_color . ';"><i class="fa fa-google-plus"></i></a></li>'; } if ($pm_staff_linkedin_meta !== '') { $html .= '<li><a href="' . $pm_staff_linkedin_meta . '" target="' . $target . '" style="background-color:' . $icon_color . ';"><i class="fa fa-linkedin"></i></a></li>'; } $html .= '</ul>'; $html .= '</div>'; $html .= '<div class="pm-staff-profile-details">'; $html .= '<p class="pm-staff-profile-name" style="color:' . $name_color . ';">' . $postTitle . '</p>'; $html .= '<p class="pm-staff-profile-title" style="color:' . $title_color . ';">' . $pm_staff_title_meta . '</p>'; $html .= '<p class="pm-staff-profile-bio" style="color:' . $text_color . ';">' . $postExcerpt . '</p>'; $html .= '</div>'; $html .= '</div>'; return $html; }
function widget($args, $instance) { extract($args); echo $before_widget; $title = apply_filters('widget_title', $instance['title']); $fa_icon = '<i class="' . (empty($instance['fa_icon']) ? '' : $instance['fa_icon']) . ' pm-sidebar-icon"></i> '; $numOfPosts = empty($instance['numOfPosts']) ? '3' : $instance['numOfPosts']; if (!empty($title)) { echo $before_title . $fa_icon . $title . $after_title; } //end of if /* post_author post_date post_date_gmt post_content post_title post_category post_excerpt post_status comment_status ping_status post_name comment_count */ //retrieve recent posts $args = array('numberposts' => $numOfPosts, 'offset' => 0, 'category' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'post', 'post_status' => 'publish', 'suppress_filters' => true); $recent_posts = wp_get_recent_posts($args, ARRAY_A); echo '<ul class="pm-recent-blog-posts">'; //front-end widget code here foreach ($recent_posts as $recent) { $featuredPostImage = get_post_meta($recent["ID"], 'pm_featured_post_image_meta', true); $featuredPostThumb = wp_get_attachment_thumb_url(get_post_thumbnail_id($recent["ID"])); $excerpt = $recent["post_excerpt"]; $bgImage = $featuredPostImage != '' ? $featuredPostImage : htmlentities($featuredPostThumb); $title = $recent["post_title"]; $excerpt = $recent["post_excerpt"]; $date = $recent["post_date"]; $month = date("M", strtotime($date)); $day = date("d", strtotime($date)); $year = date("Y", strtotime($date)); $author = $recent["post_author"]; $user_info = get_userdata($author); $comment_count = $recent["comment_count"]; echo '<li>'; if ($featuredPostImage !== '') { echo '<div class="pm-recent-blog-post-thumb" style="background-image:url(' . $featuredPostImage . ');"></div>'; } elseif ($featuredPostThumb) { echo '<div class="pm-recent-blog-post-thumb" style="background-image:url(' . $bgImage . ');"></div>'; } else { //no image to display } echo '<div class="pm-recent-blog-post-details">'; echo '<a href="' . get_permalink($recent["ID"]) . '">' . pm_ln_string_limit_words($title, 9) . '</a>'; if ($comment_count == 1) { echo '<p class="pm-comment-count"><i class="fa fa-comment"></i> ' . $comment_count . ' comment</p>'; } else { echo '<p class="pm-comment-count"><i class="fa fa-comment"></i> ' . $comment_count . ' comments</p>'; } echo '</div>'; echo '</li>'; } //end of foreach echo '</ul>'; echo $after_widget; }
echo $day; ?> </p> </div> </div> <div class="pm-event-item-desc"> <p class="pm-event-item-title"><?php the_title(); ?> </p> <div class="pm-event-item-divider"></div> <p class="pm-event-item-excerpt"> <?php $excerpt = get_the_excerpt(); echo pm_ln_string_limit_words($excerpt, 20) . ' <a href="' . get_the_permalink() . '">{...}</a>'; ?> </p> <div class="pm-event-item-divider"></div> <ul class="pm-event-item-btns"> <li><a href="<?php the_permalink(); ?> " class="pm-rounded-btn small"><?php _e('More Info', 'viennatheme'); ?> </a></li> <?php if ($pm_event_fan_page_meta !== '') { ?> <li><a href="<?php