public function content($atts, $content = null) { $el_class = $width = $el_position = ''; extract(shortcode_atts(array('el_class' => '', 'el_position' => '', 'width' => '1/2'), $atts)); $output = $items_nav = $items = ''; // get all the categories from the database $cat_args = array('taxonomy' => 'faqs-category'); $cats = get_categories($cat_args); // FAQ NAVIGATION $items_nav .= '<h3>' . __("Browse F.A.Q. Topics", "swiftframework") . '</h3>'; $items_nav .= '<ul class="faqs-nav clearfix">'; foreach ($cats as $cat) { if (function_exists('icl_object_id')) { if ($cat->term_id != icl_object_id($cat->term_id, 'faqs-category', false, ICL_LANGUAGE_CODE)) { return; } } $items_nav .= '<li><a href="#' . $cat->slug . '"><i class="icon-list"></i>' . $cat->name . '<span class="count">' . $cat->count . '</span></a></li>'; } $items_nav .= '</ul>'; // FAQ LISTINGS foreach ($cats as $cat) { // setup the category ID $cat_id = $cat->term_id; if (function_exists('icl_object_id')) { if ($cat_id != icl_object_id($cat_id, 'faqs-category', false, ICL_LANGUAGE_CODE)) { return; } } // Make a header for the cateogry $items .= '<h3 class="faq-section-title" id="' . $cat->slug . '">' . $cat->name . '</h3>'; $faqs_args = array('post_type' => 'faqs', 'post_status' => 'publish', 'faqs-category' => $cat->slug, 'posts_per_page' => 100); $faqs = new WP_Query($faqs_args); $items .= '<ul class="faqs-section clearfix">'; // PORTFOLIO LOOP while ($faqs->have_posts()) { $faqs->the_post(); $faq_title = get_the_title(); $faq_text = get_the_content_with_formatting(); $items .= '<li class="faq-item">'; $items .= '<h6>' . $faq_title . '</h6>'; $items .= '<div class="faq-text">' . do_shortcode($faq_text) . '</div>'; $items .= '</li>'; } $items .= '<div class="wpb_divider go_to_top_icon1 wpb_content_element "><a class="animate-top" href="#"><i class="icon-arrow-up"></i></a></div>'; $items .= '</ul>'; wp_reset_postdata(); } $el_class = $this->getExtraClass($el_class); $width = wpb_translateColumnWidthToSpan($width); $output .= "\n\t" . '<div class="wpb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="wpb_wrapper faqs-wrap">'; $output .= "\n\t\t\t" . $items_nav; $output .= "\n\t\t\t" . $items; $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper'); $output .= "\n\t" . '</div> ' . $this->endBlockComment($width); // $output = $this->startRow($el_position) . $output . $this->endRow($el_position); return $output; }
function bootsavvy_page_conditionals() { global $post; $page_content = ''; switch ($post->post_name) { case 'sample-filtering': $page_content = bootsavvy_get_sample_filtering(); break; default: $page_content = get_the_content_with_formatting(); break; } echo $page_content; }
function staff_archive_output() { $args = array('post_type' => 'staff', 'posts_per_page' => 200); query_posts($args); if (have_posts()) { while (have_posts()) { the_post(); $pid = get_the_ID(); if (has_post_thumbnail()) { // check if the post has a Post Thumbnail assigned to it. $image_id = get_post_thumbnail_id($pid); $url = wp_get_attachment_image_src($image_id, 'post_card_large', true)[0]; } $sub = get_post_meta($pid, 'staff_title', 'true'); $twitter = get_post_meta($pid, 'staff_twitter', 'true'); $facebook = get_post_meta($pid, 'staff_facebook', 'true'); $instagram = get_post_meta($pid, 'staff_instagram', 'true'); echo '<article class="staff_single"> <div class="col_1"> <img src="' . $url . '">.'; if (!empty($twitter)) { echo '<a href="' . $twitter . '"><svg><use xlink:href="#twitter-icon"></use></svg></a>'; } if (!empty($facebook)) { echo '<a href="' . $facebook . '"><svg><use xlink:href="#facebook-icon"></use></svg></a>'; } if (!empty($instagram)) { echo '<a href="' . $instagram . '"><svg><use xlink:href="#instagram-icon"></use></svg></a>'; } echo '</div> <div class="col_2"> <h1>' . get_the_title() . '</h1> <h2>' . $sub . '</h2> <div class="content"> ' . get_the_content_with_formatting() . ' </div> </div> '; echo '</article>'; } } }
$attachment_id = get_post_thumbnail_id($post->ID); $url_post_img = wm_image_resize($post_featured_img_width, $post_featured_img_height, wp_get_attachment_url($attachment_id)); if ($show_image_lightbox == 'enable') { echo '<a href="' . $org_img_url . '" class="image lightbox_blog" title="' . get_the_title() . '" rel="gallery"><img src="' . $url_post_img . '" title="' . get_the_title() . '" class="blog_thumbnail"/></a>'; } else { echo '<a href="' . get_permalink($post->ID) . '" class="image" title="' . get_the_title() . '"><img src="' . $url_post_img . '" title="' . get_the_title() . '" class="blog_thumbnail"/></a>'; } } ?> <!-- END Post thubmnail --> <!-- POST Content --> <?php ///Enable the gallery with next previous of images if ($data['wm_enable_rtf_excerpts'] == '0') { echo get_the_content_with_formatting($data['wm_read_more_text']); } elseif ($data['wm_blog_img_gallery_nxt_prev'] == "1") { $post_content = get_content(); //$post_content = apply_filters('the_content', $post_content); //$post_content = str_replace(']]>', ']]>', $post_content); $post_content = str_replace("<a ", "<a rel='prettyPhoto[gallery]' ", $post_content); $post_content = str_replace("(more...)", $data['wm_read_more_text'], $post_content); $post_content = str_replace("(more…)", $data['wm_read_more_text'], $post_content); echo $post_content; } else { $post_content = get_content(); $post_content = str_replace("(more...)", $data['wm_read_more_text'], $post_content); $post_content = str_replace("(more…)", $data['wm_read_more_text'], $post_content); echo $post_content; } ?>
$feat_area .= get_the_post_thumbnail(get_the_ID(), 'snpshpwp-square'); } if ($format !== 'quote') { $heading .= '<h3 class="snpshpwp_blog_title"><a href="' . get_permalink() . '" rel="bookmark">' . $sticky_icon . get_the_title() . '</a></h3>'; } $timecode = get_the_date(); $num_comments = get_comments_number(); if (comments_open()) { if ($num_comments == 0) { $comments = __('still no comments', 'snpshpwp'); } elseif ($num_comments > 1) { $comments = $num_comments . ' ' . __('Comments', 'snpshpwp'); } else { $comments = __('1 Comment', 'snpshpwp'); } $write_comments = __('with', 'snpshpwp') . ' ' . '<a href="' . get_comments_link() . '">' . $comments . '</a>'; } else { $write_comments = __('Comments are off for this post.', 'snpshpwp'); } $heading .= '<div class="snpshpwp_posts_meta"><div class="snpshpwp_category_meta">' . __('Published in', 'snpshpwp') . ' ' . get_the_category_list(', ') . '</div> <div class="snpshpwp_date_meta">' . __('on ') . '<a href="' . get_month_link(get_the_time('Y'), get_the_time('m')) . '" title="' . __('View all posts this month', 'snpshpwp') . '">' . $timecode . '</a></div> <div class="snpshpwp_author_meta">' . __('by', 'snpshpwp') . ' ' . get_the_author_link() . '</div> <div class="snpshpwp_comment_meta">' . $write_comments . '</div></div>'; $out .= $feat_area . '<div class="snpshpwp_post">' . $heading; if ($format !== 'quote') { if ($snpshpwp_data['blog_layout'] !== '1') { $excerpt = get_the_excerpt(); $out .= '<div class="snpshpwp_excerpt">' . snpshpwp_string_limit_words($excerpt, $snpshpwp_data['blog_excerpt']) . '</div>'; } else { $out .= '<div class="snpshpwp_moretag">' . get_the_content_with_formatting('<a href="' . get_permalink() . '" class="snpshpwp_readmore">' . __('Read More', 'snpshpwp') . '</a>') . '</div>'; } } $out .= '</div><div class="clearfix"></div></div>'; echo $out;
function process_template0($lastposts, $group, $Tpl, $TplElem, $TPLIndicators, $Excerpt) { $elems = ""; $indicators = ""; $pos = 1; foreach ($lastposts as $post) { setup_postdata($post); $extra_class = ""; if ($pos == 1) { $extra_class .= " active"; } if ($Excerpt) { $content = get_the_excerpt(); } else { $content = get_the_content_with_formatting(); } $title = get_the_title($post); $url = get_permalink($post); $elem = $TplElem; $elem = str_replace('$pos', $pos, $elem); $elem = str_replace('$pos0', $pos - 1, $elem); $elem = str_replace('$group', $group, $elem); $elem = str_replace('$extra_class', $extra_class, $elem); $elem = str_replace('$content', $content, $elem); $elem = str_replace('$title', $title, $elem); $elem = str_replace('$url', $url, $elem); $elems .= $elem; $elem = $TplIndicators; $elem = str_replace('$pos', $pos, $elem); $elem = str_replace('$pos0', $pos - 1, $elem); $elem = str_replace('$group', $group, $elem); $elem = str_replace('$extra_class', $extra_class, $elem); $elem = str_replace('$content', $content, $elem); $elem = str_replace('$title', $title, $elem); $elem = str_replace('$url', $url, $elem); $indicators .= $elem; $pos++; } $contents = $Tpl; $contents = str_replace('$group', $group, $contents); $contents = str_replace('$indicators', $indicators, $contents); $contents = str_replace('$elems', $elems, $contents); wp_reset_postdata(); return $contents; }
protected function content($atts, $content = null) { $title = $show_hide = $width = $item_class = $el_class = $output = $filter = $items = $el_position = ''; extract(shortcode_atts(array('title' => '', "category" => 'all', 'social_icon_type' => 'dark', 'el_position' => '', 'width' => '1/1', 'el_class' => ''), $atts)); // CATEGORY SLUG MODIFICATION if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); global $post, $wp_query, $carouselID; if ($carouselID == "") { $carouselID = 1; } else { $carouselID++; } $args = array('post_type' => 'team', 'post_status' => 'publish', 'team-category' => $category_slug, 'posts_per_page' => -1, 'ignore_sticky_posts' => 1); $team_members = query_posts($args); $count = $columns = 0; $sidebar_config = get_post_meta(get_the_ID(), 'sf_sidebar_config', true); if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") { $item_class = 'span2'; } else { if ($sidebar_config == "both-sidebars") { $item_class = 'span-bs-quarter'; } else { $item_class = 'span3'; } } if ($width == "1/4") { $columns = 1; } else { if ($width == "1/2") { $columns = 2; } else { if ($width == "3/4") { $columns = 3; } else { $columns = 4; } } } $list_class = ''; if ($show_hide == "yes") { $list_class = 'has-show-hide'; } if (have_posts()) { $items .= '<ul id="carousel-' . $carouselID . '" class="team-members carousel-items ' . $list_class . ' clearfix" data-columns="' . $columns . '">'; while (have_posts()) { the_post(); $member_name = get_the_title(); $member_position = get_post_meta($post->ID, 'sf_team_member_position', true); $member_bio = get_the_content_with_formatting(); $member_email = get_post_meta($post->ID, 'sf_team_member_email', true); $member_phone = get_post_meta($post->ID, 'sf_team_member_phone_number', true); $member_twitter = get_post_meta($post->ID, 'sf_team_member_twitter', true); $member_facebook = get_post_meta($post->ID, 'sf_team_member_facebook', true); $member_linkedin = get_post_meta($post->ID, 'sf_team_member_linkedin', true); $member_google_plus = get_post_meta($post->ID, 'sf_team_member_google_plus', true); $member_skype = get_post_meta($post->ID, 'sf_team_member_skype', true); $member_instagram = get_post_meta($post->ID, 'sf_team_member_instagram', true); $member_dribbble = get_post_meta($post->ID, 'sf_team_member_dribbble', true); $member_image = get_post_thumbnail_id(); $items .= '<li data-id="id-' . $count . '" class="clearfix carousel-item team-member ' . $item_class . '">'; $img_url = wp_get_attachment_url($member_image, 'full'); $image = aq_resize($img_url, 270, 270, true, false); $items .= '<figure>'; if ($image) { $items .= '<img src="' . $image[0] . '" width="' . $image[1] . '" height="' . $image[2] . '" />'; } $items .= '</figure>'; $items .= '<h4 class="team-member-name">' . $member_name . '</h4>'; $items .= '<h4 class="team-member-position">' . $member_position . '</h4>'; $items .= '<div class="team-member-details-wrap">'; $items .= '<div class="team-member-bio">' . do_shortcode($member_bio) . '</div>'; if ($member_email || $member_phone) { $items .= '<ul class="member-contact">'; if ($member_email) { $items .= '<li><span>E:</span> <a href="mailto:' . $member_email . '">' . $member_email . '</a></li>'; } if ($member_phone) { $items .= '<li><span>P:</span>' . $member_phone . '</li>'; } $items .= '</ul>'; } if ($member_twitter || $member_facebook || $member_linkedin || $member_google_plus || $member_skype || $member_instagram || $member_dribbble) { $items .= '<ul class="social-icons ' . $social_icon_type . ' small">'; if ($member_twitter) { $items .= '<li class="twitter"><a href="http://www.twitter.com/' . $member_twitter . '" target="_blank">Twitter</a></li>'; } if ($member_facebook) { $items .= '<li class="facebook"><a href="' . $member_facebook . '" target="_blank">Facebook</a></li>'; } if ($member_linkedin) { $items .= '<li class="linkedin"><a href="' . $member_linkedin . '" target="_blank">LinkedIn</a></li>'; } if ($member_google_plus) { $items .= '<li class="googleplus"><a href="' . $member_google_plus . '" target="_blank">Google+</a></li>'; } if ($member_skype) { $items .= '<li class="skype"><a href="skype:' . $member_skype . '" target="_blank">Skype</a></li>'; } if ($member_instagram) { $items .= '<li class="instagram"><a href="' . $member_instagram . '" target="_blank">Instagram</a></li>'; } if ($member_dribbble) { $items .= '<li class="dribbble"><a href="http://www.dribbble.com/' . $member_dribbble . '" target="_blank">Dribbble</a></li>'; } $items .= '</ul>'; } $items .= '</div>'; $items .= '</li>'; $count++; } wp_reset_query(); $items .= '</ul>'; $items .= '<a href="#" class="prev"><i class="icon-chevron-left"></i></a><a href="#" class="next"><i class="icon-chevron-right"></i></a>'; } $width = wpb_translateColumnWidthToSpan($width); $el_class = $this->getExtraClass($el_class); $output .= "\n\t" . '<div class="wpb_team_carousel_widget wpb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="wpb_wrapper carousel-wrap">'; if ($title != '') { $output .= "\n\t\t\t" . '<div class="heading-wrap"><h3 class="wpb_heading">' . $title . '</h3></div>'; } else { $output .= "\n\t\t\t" . '<div class="heading-wrap"></div>'; } $output .= "\n\t\t\t\t" . $items; $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper'); $output .= "\n\t" . '</div> ' . $this->endBlockComment($width); $output = $this->startRow($el_position) . $output . $this->endRow($el_position); global $include_carousel, $include_isotope; $include_carousel = true; $include_isotope = true; return $output; }
function get_offset() { if (isset($_POST['newmonth'])) { $month = $_POST['newmonth']; $year = $_POST['newyear']; // if($chosenMonth){ // $month = $chosenMonth; // } //echo '<h1>Month is now:' . $chosenMonth . '</h1>'; /* draw table */ $monthNum = $month; $dateObj = DateTime::createFromFormat('!m', $monthNum); $monthName = $dateObj->format('F'); $calendar = '<h2 class="calendar-month">' . $monthName . ' ' . $year . '</h2><table cellpadding="0" cellspacing="0" class="calendar">'; /* table headings */ $headings = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); $calendar .= '<tr class="calendar-row calendar-header"><td class="calendar-day-head">' . implode('</td><td class="calendar-day-head">', $headings) . '</td></tr>'; /* days and weeks vars now ... */ $running_day = date('w', mktime(0, 0, 0, $month, 1, $year)); $days_in_month = date('t', mktime(0, 0, 0, $month, 1, $year)); $days_in_this_week = 1; $day_counter = 0; $dates_array = array(); /* row for week one */ $calendar .= '<tr class="calendar-row">'; /* print "blank" days until the first of the current week */ for ($x = 0; $x < $running_day; $x++) { $calendar .= '<td class="calendar-day-np"> </td>'; $days_in_this_week++; } /* keep going with days.... */ for ($list_day = 1; $list_day <= $days_in_month; $list_day++) { $calendar .= '<td class="calendar-day">'; /* add in the day number */ /** QUERY THE DATABASE FOR AN ENTRY FOR THIS DAY !! IF MATCHES FOUND, PRINT THEM !! **/ //$today = getdate(); $args = array('category_name' => 'events', 'posts_per_page' => -1, 'year' => $year, 'monthnum' => $month, 'day' => $list_day); //$posts = get_posts($args); //echo $posts; $my_query = new WP_Query($args); if ($my_query->have_posts()) { $calendar .= '<div class="day-container">'; $calendar .= '<div class="day-number">' . $list_day . '</div>'; while ($my_query->have_posts()) { $my_query->the_post(); // $do_not_duplicate = $post->ID; $post_class = implode(" ", get_post_class()); $link = get_permalink(); $calendar .= '<a href="#" class="has-event ' . $post_class . '" id="post-' . get_the_ID() . '"> ' . get_the_title() . ' </a>'; $calendar .= '<div class="hidden-calendar-poup"><h2>' . get_the_title() . '</h2>' . get_the_content_with_formatting() . '</div>'; } $calendar .= '</div>'; wp_reset_postdata(); } else { //now do future events $args = array('category_name' => 'events', 'post_status' => 'future', 'posts_per_page' => -1, 'year' => $year, 'monthnum' => $month, 'day' => $list_day); $my_query = new WP_Query($args); if ($my_query->have_posts()) { $calendar .= '<div class="day-container">'; $calendar .= '<div class="day-number">' . $list_day . '</div>'; while ($my_query->have_posts()) { $my_query->the_post(); //$do_not_duplicate = $post->ID; $post_class = implode(" ", get_post_class()); $link = get_permalink(); $calendar .= '<a href="#" class="has-event ' . $post_class . '" id="post-' . get_the_ID() . '"> ' . get_the_title() . ' </a>'; $calendar .= '<div class="hidden-calendar-poup"><h2>' . get_the_title() . '</h2><div>' . get_the_content_with_formatting() . '</div></div>'; } $calendar .= '</div>'; wp_reset_postdata(); } else { $calendar .= '<div class="day-container">'; $calendar .= '<div class="day-number">' . $list_day . '</div>'; } } // if($posts){ // foreach ( $posts as $post ) : setup_postdata( $post ); // $link = get_permalink(); // $calendar.= '<a href="'. $link .'"> Event </a>'; // //echo $list_day; // endforeach; // }else { // //echo 'this is the future posts'; // wp_reset_postdata(); // $args = array( // 'category_name' => 'events', // 'post_status' => 'future', // 'posts_per_page' => -1, // 'year' => $year, // 'monthnum' => $month, // 'day' => $list_day // ); // $posts = get_posts($args); // foreach ( $posts as $post ) : setup_postdata( $post ); // $link = get_permalink(); // $calendar.= '<a href="'. $link .'"> Event date: '.$list_day.' </a>'; // //the_title(); // //echo $list_day; // endforeach; // } //echo '<p>Hit</p>'; //wp_reset_postdata(); $calendar .= str_repeat('<p> </p>', 2); $calendar .= '</td>'; if ($running_day == 6) { $calendar .= '</tr>'; if ($day_counter + 1 != $days_in_month) { $calendar .= '<tr class="calendar-row">'; } $running_day = -1; $days_in_this_week = 0; } $days_in_this_week++; $running_day++; $day_counter++; } /* finish the rest of the days in the week */ if ($days_in_this_week < 8) { for ($x = 1; $x <= 8 - $days_in_this_week; $x++) { $calendar .= '<td class="calendar-day-np"> </td>'; } } /* final row */ $calendar .= '</tr>'; /* end the table */ $calendar .= '</table>'; /* all done, return result */ echo $calendar; } //die; }
function widget($args, $instance) { extract($args); $per_page = $instance["perpage"]; if (ULTIMATUM_LOOP != 'wp') { include "loops/" . ULTIMATUM_LOOP . ".php"; } else { if (is_single() || is_page()) { if (preg_match('/.php/i', $instance["single"])) { $loopfile = $instance["single"]; } } else { global $wp_query; $paged = get_query_var('paged') && get_query_var('paged') > 1 ? get_query_var('paged') : 1; $args = array_merge($wp_query->query, array('posts_per_page' => $per_page, "paged" => $paged)); query_posts($args); if (preg_match('/.php/i', $instance["multiple"])) { $loopfile = $instance["multiple"]; } } if ($loopfile) { include THEME_LOOPS_DIR . '/' . $loopfile; } else { $title = apply_filters('widget_title', $instance['title']); $colprops = explode('-', $instance["multiple"]); $colcount = $colprops[0]; $gallery = false; $noimage = false; $rel = ''; switch ($colcount) { case '1': $grid = $grid_width; $cols = 1; $colw = $grid_width; break; case '2': $grid = ($grid_width - $instance["mmargin"]) / 2; $cols = 2; $colw = $grid; break; case '3': $grid = ($grid_width - $instance["mmargin"] * 2) / 3; $cols = 3; $colw = $grid; break; case '4': $grid = ($grid_width - $instance["mmargin"] * 3) / 4; $cols = 4; $colw = $grid; break; } ?> <div id="content"> <?php $i = 1; if (is_single() || is_page()) { if (have_posts()) { while (have_posts()) { the_post(); global $post; switch ($instance["single"]) { case 'rimage': $image = true; $align = "float:right;margin-left:20px;"; $imgw = $instance["singlew"]; break; case 'limage': $image = true; $align = "float:left;margin-right:20px;"; $imgw = $instance["singlew"]; break; case 'fimage': $image = true; $imgw = $grid_width; $imgw = $instance["singlew"]; $align = ''; break; default: $image = false; $align = ''; break; } $styler = ' <style type="text/css"> #' . $widget_id . '{ float:left; width:100%; } #' . $widget_id . ' .aligner{ ' . $align . ' } '; if ($responsivetheme) { $styler .= ' @media screen and (min-width:720px) and (max-width: 979px) { #' . $widget_id . '{ float:left; width:100%; margin-right:0; } #' . $widget_id . ' .aligner {'; if (isset($align)) { $styler .= $align; } else { $styler .= 'width:100%;'; } $styler .= ' } #' . $widget_id . ' .aligner img{ max-width:100%; } } @media screen and (min-width:240px) and (max-width: 719px) { #' . $widget_id . '{ float:left; width:100%; } #' . $widget_id . ' .aligner { width:100%; } #' . $widget_id . ' .aligner img{ max-width:100%; } }'; } $styler .= '</style>'; echo $styler; ?> <div class="post-<?php echo $post->ID; ?> ultimatepost" id="<?php echo $widget_id; ?> "> <div class="post-inner-single"> <?php if ($image) { $img = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); if (!isset($img) && $instance["noimage"] == 'true') { if (get_theme_option('general', 'noimage')) { $img[0] = get_theme_option('general', 'noimage'); } else { $img[0] = THEME_URI . '/images/no-image.jpg'; } $imgsrc = UltimatumImageResizer(null, $img[0], $imgw, $instance["singleh"], true); } else { $imgsrc = UltimatumImageResizer(get_post_thumbnail_id(), null, $imgw, $instance["singleh"], true); } } if ($image && $img) { ?> <div class="aligner" > <?php if ($instance["gallery"] == 'nivo') { $this->post_gallery('nivo', $imgw, $instance["singleh"], $instance["thumbs"], $instance); } else { ?> <?php if ($instance["meta"] == 'bimage') { echo $this->blog_meta($instance); } ?> <?php if ($img) { ?> <a href="<?php if ($gallery) { echo $link; } else { the_permalink(); } ?> " <?php echo $rel; ?> > <img src="<?php echo $imgsrc; ?> " alt="<?php the_title(); ?> " /></a> <?php } ?> <?php if ($instance["gallery"] == 'aimage') { $this->post_gallery('thumbs', $imgw, $instance["singleh"], $instance["thumbs"], $instance); } ?> <?php } ?> <?php if ($instance["meta"] == 'aimage') { echo $this->blog_meta($instance); } ?> </div> <?php } ?> <div> <?php if ($instance["title"] == 'true') { ?> <h2 class="post-header"><a class="post-title" href="<?php the_permalink(); ?> " ><?php the_title(); ?> </a></h2> <?php } ?> <?php if ($instance["meta"] == 'atitle') { echo $this->blog_meta($instance); } ?> <div class="the-post-content"> <?php $retainformat = false; if ($retainformat) { $content = get_the_content_with_formatting(); $content = apply_filters('the_content', $content); echo $content; } else { the_content(); } ?> <?php wp_link_pages(); ?> </div> <?php if ($instance["meta"] == 'atext') { echo $this->blog_meta($instance); } if ($instance["cats"] == 'acontent' && !is_page()) { $_tax = get_the_taxonomies(); if (empty($_tax)) { } else { foreach ($_tax as $key => $value) { preg_match('/(.+?): /i', $value, $matches); $tax[] = '<span class="entry-tax-' . $key . '">' . str_replace($matches[0], '<span class="entry-tax-meta">' . $matches[1] . ':</span> ', $value) . '</span>'; } } echo '<div class="post-taxonomy">' . join('<br />', $tax) . '</div>'; } ?> </div> </div> <?php //echo get_post_meta($post->ID, 'ultimatum_author', true); if (get_post_meta($post->ID, 'ultimatum_author', true) == 'true') { if (get_the_author_meta('description') && is_multi_author()) { // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?> <div id="author-info"> <div id="author-avatar"> <?php echo get_avatar(get_the_author_meta('user_email'), 68); ?> </div><!-- #author-avatar --> <div id="author-description"> <h2><?php printf(esc_attr__('About %s', THEME_LANG_DOMAIN), get_the_author()); ?> </h2> <?php the_author_meta('description'); ?> <div id="author-link"> <a href="<?php echo esc_url(get_author_posts_url(get_the_author_meta('ID'))); ?> " rel="author"> <?php printf(__('View all posts by %s <span class="meta-nav">→</span>', THEME_LANG_DOMAIN), get_the_author()); ?> </a> </div><!-- #author-link --> </div><!-- #author-description --> </div><!-- #entry-author-info --> <?php } } ?> </div> <div class="clearboth"></div> <?php if ($instance['show_comments_form'] == 'true') { comments_template('', true); } } } // end of single or page Main IF for Loop } else { //multi post $colcount = $cols; if ($colcount == 1 && ($colprops[2] == 'ri' || $colprops[2] == 'li' || $colprops[2] == 'gl' || $colprops[2] == 'gr')) { $imgw = $instance[multiplew]; } else { $imgw = $colw; } switch ($colprops[2]) { case 'ri': $align = 'float:right;margin-top:4px;margin-left:15px;'; break; case 'li': $align = 'float:left;margin-top:4px;margin-right:15px;'; break; case 'gl': $align = 'float:left;margin-top:4px;margin-right:15px;'; $rel = 'rel="prettyPhoto[]"'; $gallery = true; break; case 'gr': $align = 'float:right;margin-left:15px;margin-top:4px;'; $rel = 'rel="prettyPhoto[]"'; $gallery = true; break; case 'g': $rel = 'rel="prettyPhoto[]"'; $gallery = true; $align = ''; break; case 'i': $align = ''; break; default: $noimage = true; $align = ''; break; } //Print the Style $styler = ' <style type="text/css"> .ultimatepost{ float:left; width:' . $grid . 'px;'; if (isset($instance['mmargin'])) { $styler .= 'margin-right:' . $instance["mmargin"] . 'px;'; } $styler .= '} .ultimatepost .aligner{ ' . $align . ' } '; if ($responsivetheme) { $styler .= ' @media screen and (min-width:720px) and (max-width: 979px) { .ultimatepost{ float:left; width:100%; margin-right:0; } .ultimatepost .aligner {'; if (isset($align)) { $styler .= $align; } else { $styler .= 'width:100%;'; } $styler .= ' } .ultimatepost .aligner img{ max-width:100%; } } @media screen and (min-width:240px) and (max-width: 719px) { .ultimatepost{ float:left; width:100%; } .ultimatepost .aligner { width:100%; } .ultimatepost .aligner img{ max-width:100%; } }'; } $styler .= '</style>'; echo $styler; if (!have_posts()) { $shownopostsmsg = isset($instance['shownopostsmsg']) ? $instance['shownopostsmsg'] : ''; $nopostsmsg = isset($instance['nopostsmsg']) ? $instance['nopostsmsg'] : ''; if ($shownopostsmsg) { ?> <div id=" <?php echo $widget_id . '-noposts'; ?> class="tricky-dflt-noposts" > <?php echo $nopostsmsg; ?> </div> <?php } } if (have_posts()) { if ($instance["mtitle"] == 'true') { ?> <h1 class="multi-post-title"><?php echo strip_tags(wp_title('', false, 'left')); ?> </h1> <?php } global $wp_query; $paged = get_query_var('paged') && get_query_var('paged') > 1 ? get_query_var('paged') : 1; $args = array_merge($wp_query->query, array('posts_per_page' => $per_page, "paged" => $paged)); query_posts($args); while (have_posts()) { the_post(); global $post; if ($colcount != 1) { //gridd if ($i == 1) { $i++; $gps = false; } elseif ($i == $colcount) { $gps = true; $i = 1; } else { $i++; $gps = false; } } else { $grid = ''; $gps = ''; } //gridd ?> <div class="post post-<?php echo $post->ID; ?> ultimatepost <?php if ($gps) { echo "last"; } ?> "> <div class="post-inner"> <?php $img = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); if (!$img && $instance["mnoimage"] == 'true') { if (get_theme_option('general', 'noimage')) { $img[0] = get_theme_option('general', 'noimage'); } else { $img[0] = THEME_URI . '/images/no-image.jpg'; } $imgsrc = UltimatumImageResizer(null, $img[0], $imgw, $instance["multipleh"], true); } else { $imgsrc = UltimatumImageResizer(get_post_thumbnail_id(), null, $imgw, $instance["multipleh"], true); } if (!$noimage) { $video = get_post_meta($post->ID, 'ultimatum_video', true); $sc = '[video width="100%" height="' . $instance["multipleh"] . '"]' . $video . '[/video]'; if ($imgw != $colw || $instance["mimgpos"] == 'btitle') { ?> <div class="aligner"> <div class="featured-image"> <?php if ($gallery) { if ($video) { $link = $video . ''; } else { $link = $img[0]; } } if ($img) { if ($video && $instance["mvideo"] == 'replace') { echo do_shortcode($sc); } else { ?> <a href="<?php if ($gallery) { echo $link; } else { the_permalink(); } ?> " <?php echo $rel; ?> class="preload <?php if ($gallery) { if ($video) { echo 'image_play'; } else { echo 'image_zoom'; } } ?> " style="position:relative;float:left;padding:0;margin:0;line-height:0px;" > <img src="<?php echo $imgsrc; ?> " style="padding:0;margin:0;line-height:0px;" alt="<?php the_title(); ?> " /> </a> <?php } if ($video && $instance["mvideo"] == 'aimage') { echo do_shortcode($sc); } } ?> </div> <?php if ($instance["mmeta"] == 'aimage') { echo $this->blog_multimeta($instance); } ?> </div> <?php } } if (!$grid) { $wi = $grid_width - ($imgw + 15); echo '<div>'; } else { echo '<div>'; } ?> <h2 class="post-header"> <?php if ($rel) { ?> <?php the_title(); ?> <?php } else { ?> <a class="post-title" href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> <?php } ?> </h2> <?php if ($imgw == $colw && $instance["mimgpos"] == 'atitle') { ?> <div class="aligner"> <div class="featured-image"> <?php if ($gallery) { if ($video) { $link = $video . ''; } else { $link = $img[0]; } } if ($img) { ?> <?php if ($video && $instance["mvideo"] == 'replace') { ?> <?php echo do_shortcode($sc); ?> <?php } else { ?> <a href="<?php if ($gallery) { echo $link; } else { the_permalink(); } ?> " <?php echo $rel; ?> class="preload"><img src="<?php echo $imgsrc; ?> " alt="<?php the_title(); ?> " /></a> <?php } ?> <?php if ($video && $instance["mvideo"] == 'aimage') { ?> <?php echo do_shortcode($sc); ?> <?php } ?> <?php } ?> </div> <?php if ($instance["mmeta"] == 'aimage') { echo $this->blog_multimeta($instance); } ?> </div> <?php } ?> <?php if ($video && $instance["mvideo"] == 'atitle') { ?> <?php echo do_shortcode($sc); ?> <?php } ?> <?php if ($instance["mmeta"] == 'atitle') { echo $this->blog_multimeta($instance); } ?> <?php if ($instance["excerpt"] == 'true') { ?> <p class="post-excerpt"> <?php echo wp_html_excerpt(get_the_excerpt(), $instance["excerptlength"]); ?> ... <?php if ($instance["mreadmore"] == 'after') { ?> <a href="<?php the_permalink(); ?> " class="readmorecontent" > <span><?php _e($instance["rmtext"], THEME_LANG_DOMAIN); ?> </span> </a> <?php } ?> </p> <?php } elseif ($instance['excerpt'] == 'content') { ?> <p class="post-excerpt"> <?php the_content(); ?> <?php if ($instance["mreadmore"] == 'after') { ?> <a href="<?php the_permalink(); ?> " class="readmorecontent" > <span><?php _e($instance["rmtext"], THEME_LANG_DOMAIN); ?> </span> </a> <?php } ?> </p> <?php } ?> <?php if ($instance["mmeta"] == 'atext') { echo $this->blog_multimeta($instance); } if ($instance["mcats"] == 'acontent') { $_tax = array(); $tax = array(); $_tax = get_the_taxonomies(); if (empty($_tax)) { } else { foreach ($_tax as $key => $value) { preg_match('/(.+?): /i', $value, $matches); $tax[] = '<span class="entry-tax-' . $key . '">' . str_replace($matches[0], '<span class="entry-tax-meta">' . $matches[1] . ':</span> ', $value) . '</span>'; } } echo '<div class="post-meta taxonomy">' . join('<br />', $tax) . '</div>'; } if ($instance["mreadmore"] != 'false' && $instance["mreadmore"] != 'after') { ?> <p style="text-align:<?php echo $instance["mreadmore"]; ?> "> <a href="<?php the_permalink(); ?> " class="readmorecontent" > <span><?php _e($instance["rmtext"], THEME_LANG_DOMAIN); ?> </span> </a> </p> <?php } ?> </div> </div> </div> <?php if ($i == 1) { echo '<div style="clear:both"></div>'; } } } } // MainIF Finish end multi post echo '<div style="clear:both"></div>'; ?> <?php if (function_exists('wp_pagenavi')) { wp_pagenavi(); } ?> </div> <?php } } }
the_time('F j, Y'); ?> <?php edit_post_link('edit post', ', ', ''); ?> | <?php comments_number('No comment', 'Comment', '% Comments'); ?> </div> </div> <br class="clear"/><br/> <?php echo get_the_content_with_formatting(); ?> </div> <!-- End each blog post --> <?php } } ?> <div class="pagination"><p><?php posts_nav_link(' ');
function shortcode_blog($atts, $content = null) { global $postParentPageID; extract(shortcode_atts(array('cats' => '', 'featured_images' => 'true', 'per_page' => '5', 'orderby' => 'date', 'order' => 'desc', 'offset' => '0', 'title' => 'true', 'meta_data' => 'true', 'content_display' => 'excerpt', 'pagination' => 'true'), $atts)); global $wp_query, $data; // Pagination if (get_query_var('paged')) { $paged = get_query_var('paged'); } elseif (get_query_var('page')) { $paged = get_query_var('page'); } else { $paged = 1; } // Post Query $args = array('post_type' => 'post', 'post_status' => 'publish', 'cat' => $cats, 'paged' => $paged, 'caller_get_posts' => 1, 'orderby' => $orderby, 'order' => $order, 'posts_per_page' => $per_page, 'offset' => $offset); $featured_query = new wp_query($args); ob_start(); ?> <?php while ($featured_query->have_posts()) { $featured_query->the_post(); $counter = $counter + 1; ?> <div class="post"> <?php if ($title == 'true') { ?> <h3 class="post_title"> <a title="<?php the_title(); ?> " href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> </h3> <?php } ?> <!-- Post details --> <?php if ($meta_data == 'true') { ?> <div class="metadata"> <?php if ($data['wm_date_enabled'] == '1') { //data is enabled ?> <p class="post_date"><?php the_time(get_option('date_format')); ?> </p> <?php } ?> <?php if ($data['wm_meta_comments_enabled'] == '1') { //data is enabled ?> <a href="<?php the_permalink(); ?> #comments" class="post_comments"><?php comments_number(__('No comments', 'kslang'), __('1 comment', 'kslang'), __('% comments', 'kslang')); ?> </a> <?php } ?> </div> <?php } ?> <!-- Post thubmnail --> <?php $postid = $featured_query->post->ID; if ($featured_images == 'true') { //show the image in lightbox $show_image_lightbox = get_post_meta($postid, 'kingsize_featured_img_lightbox', true); //POST featured image height if (get_post_meta($postid, 'kingsize_post_featured_img_height', true)) { $post_featured_img_height = get_post_meta($postid, 'kingsize_post_featured_img_height', true); } else { $post_featured_img_height = 180; } //Sidebar enabled if ($data['wm_page_sidebar_enabled'] == "1" && (get_post_meta($postParentPageID, 'page_sidebar_hide', true) == "" && get_post_type($postParentPageID) == 'page')) { $post_featured_img_width = 460; } elseif ($data['wm_page_sidebar_enabled'] == "1" && (get_post_meta($postParentPageID, 'post_sidebar_hide', true) == "" && get_post_type($postParentPageID) == 'post')) { $post_featured_img_width = 460; } else { $post_featured_img_width = 680; } if (has_post_thumbnail()) { // POST has thumbnail $org_img_url = wp_get_attachment_url(get_post_thumbnail_id($postid)); $attachment_id = get_post_thumbnail_id($postid); $url_post_img = wm_image_resize($post_featured_img_width, $post_featured_img_height, wp_get_attachment_url($attachment_id)); if ($show_image_lightbox == 'enable') { echo '<a href="' . $org_img_url . '" class="image lightbox_blog" title="' . get_the_title() . '" rel="gallery"><img src="' . $url_post_img . '" alt="' . get_the_title() . '" class="blog_thumbnail"/></a>'; } else { echo '<a href="' . get_permalink($postid) . '" class="image" title="' . get_the_title() . '"><img src="' . $url_post_img . '" alt="' . get_the_title() . '" class="blog_thumbnail"/></a>'; } } } ?> <!-- END Post thubmnail --> <!-- POST Content --> <?php ///Enable the gallery with next previous of images if ($content_display == 'excerpt') { //when content_display='excerpt' echo get_the_content_with_formatting($data['wm_read_more_text']); } elseif ($content_display == 'rtf') { //when content_display='gallery' global $more; $more = 0; the_content($data['wm_read_more_text']); } elseif ($content_display == '' || $content_display == 'full') { //show full content when content_display='full' $post_content = get_content(); $post_content = str_replace("(more...)", $data['wm_read_more_text'], $post_content); $post_content = str_replace("(more…)", $data['wm_read_more_text'], $post_content); echo $post_content; } ?> <!-- POST Content END --> </div> <?php } ?> <?php if ($pagination == "true") { kingsize_pagination($featured_query->max_num_pages); } $output_string = ob_get_contents(); ob_end_clean(); wp_reset_postdata(); return $output_string; }
?> <img class="cover" src="<?php echo $record_cover['url']; ?> " alt="<?php echo $record_cover['alt']; ?> " /> <?php } ?> <div class="description"> <p class="title">ABOUT</p> <?php $description = get_the_content_with_formatting(); ?> <?php echo add_read_more(clean_html($description)); ?> </div> <div class="mobile-details"> <div class="left"></div> <div class="right"></div> </div> <?php $band_pic_1 = get_field('release-band_pic_1'); $band_pic_2 = get_field('release-band_pic_2'); if (!empty($band_pic_1)) {
function menu_item() { $pid = $_POST['post_id']; query_posts('p=' . $pid . '&post_type=items'); if (have_posts()) { while (have_posts()) { the_post(); $price_lrg = get_post_meta($pid, 'items_price_lrg', 'true'); $price_reg = get_post_meta($pid, 'items_price_reg', 'true'); $based = get_post_meta($pid, 'items_base', 'true'); $sodium = get_post_meta($pid, 'items_sodium', 'true'); $fat = get_post_meta($pid, 'items_fat', 'true'); $carb = get_post_meta($pid, 'items_carb', 'true'); $cal = get_post_meta($pid, 'items_cal', 'true'); $money = get_post_meta($pid, 'items_money', 'true'); $sub = get_post_meta($pid, 'items_sub', 'true'); if (has_post_thumbnail()) { // check if the post has a Post Thumbnail assigned to it. $image_id = get_post_thumbnail_id($pid); $url = wp_get_attachment_image_src($image_id, 'post_card_large', true)[0]; } $cal_string = ''; $carb_string = ''; $fat_string = ''; $sodium_string = ''; $price = ''; if ($price_lrg !== '0.00' && $price_reg !== '0.00') { $price = '<div class="price"> <span><small>Large:</small> <strong>$' . $price_lrg . '</strong></span> <span><small>Small:</small> <strong>$' . $price_reg . '</strong></span> </div>'; } else { $price = '<div class="price"> <span><small>Price:</small> <strong>$' . $price_reg . '</strong></span> </div>'; } if (!empty($based)) { $base_string = '<div class="serving"> <small>Serving Size:</small> <strong>' . $based . '</strong> </div>'; } if (!empty($cal)) { $cal_string = '<div class="cell"> <strong>' . $cal . '</strong> <small>Calories</small></div>'; } if (!empty($carb)) { $carb_string = '<div class="cell"> <strong>' . $carb . '</strong> <small>Carbs (g)</small> </div>'; } if (!empty($fat)) { $fat_string = '<div class="cell"> <strong>' . $fat . '</strong> <small>Total Fat (g)</small> </div>'; } if (!empty($sodium)) { $sodium_string = '<div class="cell"> <strong>' . $sodium . '</strong> <small>Sodium (mg)</small> </div>'; } $data = ' <div class="close"> <svg><use xlink:href="#icon-close"></use></svg> </div> <div class="wrapper"> <div class="col_2"> <div class="img-wrap"><img src="' . $url . '"></div> </div> <div class="col_1"> <h2>' . get_the_title() . '</h2> <div class="content"> ' . get_the_content_with_formatting() . ' </div> </div> </div>'; } } wp_reset_postdata(); echo '<article class="item_single">' . $data . '</article>'; die; }