/** * Heli the format content link. * * Set up the content. * * @package WordPress * @subpackage Heli * @since Heli 1.0 */ function img_link() { $images = rwmb_meta('as_bg_link', 'type=image'); foreach ($images as $image) { echo "{$image['full_url']}"; } }
function al_portfolio_meta_tags() { $post_type = get_post_type(); if ('portfolio' == $post_type) { $title = get_post_meta(get_the_ID(), "al_pf_og_title", TRUE); $title = !empty($title) ? $title : get_the_title(); $meta = array('og:title' => $title, 'og:url' => get_permalink()); $desc = get_post_meta(get_the_ID(), "al_pf_og_description", TRUE); $desc = !empty($desc) ? $desc : false; if ($desc) { $meta['og:description'] = $desc; } if (has_post_thumbnail()) { $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); $meta['og:image'] = $thumbnail[0]; } if (get_post_format() == 'gallery') { $images = rwmb_meta('al_pf_gallery_images', 'type=image&size=full'); if (is_array($images)) { foreach ($images as $image) { $meta['images'][] = $image['url']; } } } foreach ($meta as $key => $value) { if ($key == 'images') { foreach ($value as $image) { echo '<meta property="og:image" content="' . $image . '" />'; } } else { echo '<meta property="' . $key . '" content="' . $value . '" />'; } } } }
function entry_content_close() { if (rwmb_meta('mak_desc') != '') { echo '<p class="short-desc">' . rwmb_meta('mak_desc') . '</p>'; } echo '</div>'; }
public function widget ($args, $instance) { echo $args["before_widget"]; if(!empty($instance["title"])) echo $args["before_title"] . apply_filters("widget_title", $instance["title"]) . $args["after_title"]; $testimonials = new WP_Query(array( "post_type" => "team-members", "orderby" => "rand" )); if($testimonials->have_posts()) { $testimonials->the_post(); ?> <div id="team-random" class="media"> <div class="media-left"> <img class="media-object" src="<? echo wp_get_attachment_image_src (array_values(rwmb_meta("team_member_footer_image"))[0]["ID"], "full")[0]; ?>"/> </div> <div class="media-body"> <h4 class="media-heading"><? echo get_the_title(); ?></h4> <p>"<? echo rwmb_meta("team_member_quote"); ?>"</p> </div> </div> <? wp_reset_postdata(); } else echo "<p>Sorry, there are no team members to be displayed</p>"; echo $args["after_widget"]; }
function widget($args, $instance) { extract($args, EXTR_SKIP); global $icon; $icon = $instance['icon']; $title = apply_filters('widget_title', $instance['title']); $number = $instance['number']; /* before widget */ echo $before_widget; /* display title */ if ($title && $icon) { echo $before_title . '<i class="fa ' . $icon . ' "></i>' . $title . $after_title; } elseif ($title) { echo $before_title . $title . $after_title; } /* display the widget */ ?> <div <?php post_class(); ?> id="images-widget-<?php the_ID(); ?> "> <div class="gallery-widget"> <ul> <?php global $post; $args = array('order' => 'DESC', 'post_type' => 'gallery', 'posts_per_page' => 1); $loop = new WP_Query($args); while ($loop->have_posts()) { $loop->the_post(); $images = rwmb_meta('gxg_gallery_images', 'type=image&size=square2', false); $i = 0; foreach ($images as $image) { $imageurl = $image['url']; $imagefull = $image['full_url']; if ($i++ < $number) { echo "<li class='prettyimage-wrap'><a class='pretty_image' title='' data-rel='prettyPhoto[pp_gallery]' href='{$imagefull}'><span class='image-rollover'><i class='gallery-resize-icon fa fa-expand'></i></span><img src='{$imageurl}' alt='' /></a></li>"; } } } wp_reset_query(); ?> </ul> </div><!-- .gallery-widget --> </div><!-- .post-? --> <?php /* after widget */ echo $after_widget; }
function ac_get_meta($key, $args = array(), $post_id = null) { // Page level meta is only relevant on singulars, or is blog page (which WP thinks is not singular) if (function_exists('rwmb_meta') && (is_singular() || ac_is_blog_page())) { return rwmb_meta('ac_' . $key, $args, $post_id); } else { return null; // return null for all options } }
protected function get() { global $post; // SLIDER $sliderPostsID = rwmb_meta('GAL_slider_art', array('type' => 'autocomplete', 'multiple' => 'true'), $post->ID); $sliderPosts = array(); foreach ($sliderPostsID as $id) { $sliderPosts[] = get_post($id); } return array('slides' => $sliderPosts); }
function home_banners_func($atts, $content = null) { // New function parameter $content is added! extract(shortcode_atts(array('width' => '1/2', 'el_position' => '', 'section_height' => '', 'loop' => '', 'slideshow' => '', 'time' => '', 'transition_time' => ''), $atts)); $output = ''; global $post; // get recent posts $args = array('post_type' => 'banner', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'caller_get_posts' => 1); $posts = new wp_query($args); // if posts exist if ($posts->have_posts()) { $output .= '<section class="flexslider std-slider" data-height="' . $section_height . '" data-loop="' . $loop . '" data-smooth="false" data-slideshow="' . $slideshow . '" data-speed="' . $time . '" data-animspeed="' . $transition_time . '" data-controls="true" data-dircontrols="true">'; $output .= '<ul class="slides">'; // loop through and display them while ($posts->have_posts()) { $posts->the_post(); if (rwmb_meta('_wp_banner_image', $post->ID)) { $images = rwmb_meta('_wp_banner_image', 'type=plupload_image', $post->ID); if (count($images) > 0) { foreach ($images as $image) { $image_url = wp_get_attachment_image_src($image['ID'], 'full'); $output .= '<li data-bg="' . $image_url[0] . '">'; } } } $output .= '<div class="container">'; $output .= '<div class="inner">'; $output .= '<div class="row">'; $output .= '<div class="text-center animated" data-fx="fadeIn">'; if (rwmb_meta('_wp_title', get_the_ID())) { $output .= '<h2>' . rwmb_meta('_wp_title', get_the_ID()) . '</h2>'; } if (rwmb_meta('_wp_sub_title', get_the_ID())) { $output .= '<p>' . rwmb_meta('_wp_sub_title', get_the_ID()) . '</p>'; } if (rwmb_meta('_wp_show_button_1', get_the_ID()) == 1) { $output .= '<a href="' . rwmb_meta('_wp_button_1_url', get_the_ID()) . '" class="btn btn-primary btn-lg local">' . rwmb_meta('_wp_button_1_text', get_the_ID()) . '</a>'; } if (rwmb_meta('_wp_show_button_2', get_the_ID()) == 1) { $output .= '<a href="' . rwmb_meta('_wp_button_2_url', get_the_ID()) . '" class="btn btn-default btn-lg">' . rwmb_meta('_wp_button_2_text', get_the_ID()) . '</a>'; } $output .= '</div>'; $output .= '<div class="col-md-6"></div>'; $output .= '</div>'; $output .= '</div>'; $output .= '</div>'; $output .= '</li>'; } $output .= '</ul>'; $output .= '</section>'; } wp_reset_query(); return $output; }
function staff_func($atts, $content = null) { // New function parameter $content is added! extract(shortcode_atts(array('width' => '1/2', 'el_position' => '', 'staff_exclude' => ''), $atts)); $output = ''; global $post; if ($staff_exclude) { $exclude = $staff_exclude; } else { $exclude = ''; } $staff = get_posts(array('post_type' => 'staff', 'order' => 'ASC', 'orderby' => 'menu_order', 'exclude' => $exclude)); if (count($staff) > 0) { //$output .= '<div class="row">'; foreach ($staff as $post) { setup_postdata($post); $output .= '<div class="col-md-3 col-sm-6">'; $output .= '<div class="personBox">'; if (rwmb_meta('_wp_staff_image', $post->ID)) { $images = rwmb_meta('_wp_staff_image', 'type=plupload_image', $post->ID); if (count($images) > 0) { foreach ($images as $image) { $image_url = wp_get_attachment_image_src($image['ID'], 'staff'); $output .= '<img src="' . $image_url[0] . '" alt="' . $image['alt'] . '" />'; } } } $output .= '<h4>' . get_the_title(); if (get_post_meta($post->ID, '_wp_staff_position', true)) { $output .= '<span>' . get_post_meta($post->ID, '_wp_staff_position', true) . '</span>'; } $output .= '</h4>'; if (get_post_meta($post->ID, '_wp_staff_facebook', true) || get_post_meta($post->ID, '_wp_staff_twitter', true) || get_post_meta($post->ID, '_wp_staff_linkedin', true)) { $output .= '<hr>'; $output .= '<ul class="socialNormal list-inline">'; if (get_post_meta($post->ID, '_wp_staff_facebook', true)) { $output .= '<li><a href="' . get_post_meta($post->ID, '_wp_staff_facebook', true) . '" data-toggle="tooltip" title="Facebook"><i class="fa fa-facebook-square"></i></a></li>'; } if (get_post_meta($post->ID, '_wp_staff_twitter', true)) { $output .= '<li><a href="' . get_post_meta($post->ID, '_wp_staff_twitter', true) . '" data-toggle="tooltip" title="Twitter"><i class="fa fa-twitter"></i></a></li>'; } if (get_post_meta($post->ID, '_wp_staff_linkedin', true)) { $output .= '<li><a href="' . get_post_meta($post->ID, '_wp_staff_linkedin', true) . '" data-toggle="tooltip" title="LinkedIn"><i class="fa fa-linkedin-square"></i></a></li>'; } $output .= '</ul>'; } $output .= '</div>'; $output .= '</div>'; } wp_reset_query(); //$output .= '</div>'; } return $output; }
/** * @param string $fieldID The string identifier for the meta field you're looking for * @param mixed $valueIfNotSet The default value, in the event this meta value isn't set for the current post * @param {int|null} $overridePostID The post ID to search for. If empty, we will use whatever get_the_id() returns. * @return mixed The current post's value for the field you requested */ function ciGetNormalizedMeta($fieldID, $valueIfNotSet, $overridePostID = null) { if (function_exists('rwmb_meta')) { $field = rwmb_meta(CI_THEME_PREFIX . "_{$fieldID}", array(), $overridePostID); if ($field === "") { $field = $valueIfNotSet; } return $field; } else { return $valueIfNotSet; } }
public function blog_shortcode($atts) { $output = $category = $author = $posts_per_page = $type = $orderby = $order = ''; extract(shortcode_atts(array('type' => '1', 'posts_per_page' => 5, 'category' => '', 'author' => '', 'orderby' => 'date', 'order' => 'DESC'), $atts)); // Explode all categories and authors ids into arrays if ($category == '') { $categories = array(); } else { $categories = explode(",", $category); } if ($author == '') { $authors = array(); } else { $authors = explode(",", $author); } $prefix = 'zen_'; if (function_exists('rwmb_meta')) { $option = rwmb_meta("{$prefix}page_sidebar"); if ($option == 'none') { $this->has_widgets = false; $this->content_class = 'col-sm-12'; } else { $this->has_widgets = true; $this->content_class = 'col-sm-9'; } } // Construct the query if (get_query_var('paged')) { $paged = get_query_var('paged'); } elseif (get_query_var('page')) { $paged = get_query_var('page'); } else { $paged = 1; } $args = array('post_type' => 'post', 'post_status' => 'publish', 'paged' => $paged, 'posts_per_page' => (int) $posts_per_page, 'orderby' => $orderby, 'order' => $order, 'category__in' => $categories, 'author__in' => $authors); $query = new WP_Query($args); $this->blog_query = $query; switch ($type) { case '1': $this->blog_style_1($query); break; case '2': $this->blog_style_2($query); break; case '3': $this->blog_style_3($query); break; } return $output; }
/** * Get post meta * * @since 1.0 * * @param string $key * @param array $args * @param int $post_id * * @return mixed */ function onehost_get_meta($key, $args = array(), $post_id = null) { if (function_exists('rwmb_meta')) { return rwmb_meta($key, $args, $post_id); } /** * Base on Meta Box plugin function */ $post_id = empty($post_id) ? get_the_ID() : $post_id; $args = wp_parse_args($args, array('type' => 'text')); // Set 'multiple' for fields based on 'type' if (!isset($args['multiple'])) { $args['multiple'] = in_array($args['type'], array('checkbox_list', 'file', 'file_advanced', 'image', 'image_advanced', 'plupload_image', 'thickbox_image')); } $meta = get_post_meta($post_id, $key, !$args['multiple']); // Get uploaded files info if (in_array($args['type'], array('file', 'file_advanced'))) { if (is_array($meta) && !empty($meta)) { $files = array(); foreach ($meta as $id) { $path = get_attached_file($id); $files[$id] = array('ID' => $id, 'name' => basename($path), 'path' => $path, 'url' => wp_get_attachment_url($id), 'title' => get_the_title($id)); } $meta = $files; } } elseif (in_array($args['type'], array('image', 'plupload_image', 'thickbox_image', 'image_advanced'))) { global $wpdb; $meta = $wpdb->get_col($wpdb->prepare("SELECT meta_value FROM {$wpdb->postmeta}\r\n\t\t\t\t\tWHERE post_id = %d AND meta_key = '%s'\r\n\t\t\t\t\tORDER BY meta_id ASC\r\n\t\t\t\t", $post_id, $key)); if (is_array($meta) && !empty($meta)) { $images = array(); foreach ($meta as $id) { $images[$id] = fastlat_get_image_info($id, $args); } $meta = $images; } } elseif ('taxonomy_advanced' == $args['type']) { if (!empty($args['taxonomy'])) { $term_ids = array_map('intval', array_filter(explode(',', $meta . ','))); // Allow to pass more arguments to "get_terms" $func_args = wp_parse_args(array('include' => $term_ids, 'hide_empty' => false), $args); unset($func_args['type'], $func_args['taxonomy'], $func_args['multiple']); $meta = get_terms($args['taxonomy'], $func_args); } else { $meta = array(); } } elseif ('taxonomy' == $args['type']) { $meta = empty($args['taxonomy']) ? array() : wp_get_post_terms($post_id, $args['taxonomy']); } return $meta; }
function clients_table_content($column_name, $post_id) { $c_opt_file = rwmb_meta("Cfile"); $c_opt_author = rwmb_meta("uploaded_by"); $c_opt_type = rwmb_meta("type"); if ($column_name == 'uploaded_by') { echo $c_opt_author; } if ($column_name == 'categories') { echo get_categories(); } if ($column_name == 'type') { echo $c_opt_type; } }
function get_rwmb_meta($field_id, $args = array(), $post_id = null) { $custom_fields = klasik_get_customdata(); if (function_exists('rwmb_meta')) { if (rwmb_meta($field_id, $args, $post_id)) { return rwmb_meta($field_id, $args, $post_id); } elseif (isset($custom_fields[$field_id])) { //return $custom_fields['klasik_layout']; } } elseif (isset($custom_fields[$field_id])) { return $custom_fields[$field_id]; } else { return false; } }
/** * Genesis Framework. * * WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances. * Please do all modifications in the form of a child theme. * * @package Genesis\Templates * @author StudioPress * @license GPL-2.0+ * @link http://my.studiopress.com/themes/genesis/ */ function added_copy() { $process = rwmb_meta('mak_process'); $ordering = rwmb_meta('mak_ordering'); if ($process != '' && $ordering != '') { ?> <div class="first one-half process"> <h3 class="small">Process</h3> <div class="entry-content"> <?php echo $process; ?> </div> </div> <div class="one-half ordering"> <h3 class="small">Ordering</h3> <div class="entry-content"> <?php echo $ordering; ?> </div> </div> <?php } elseif ($process != '' && $ordering == '') { ?> <div class="process"> <h3 class="small">Process</h3> <div class="entry-content"> <?php echo $process; ?> </div> </div> <?php } elseif ($process == '' && $ordering != '') { ?> <div class="process"> <h3 class="small">Ordering</h3> <div class="entry-content"> <?php echo $ordering; ?> </div> </div> <?php } }
function upC($atts, $content = null) { extract(shortcode_atts(array("client_name" => ""), $atts)); // WP_Query arguments $args = array('post_type' => array('clients'), 'category_name' => $client_name); // The Query $query_client = new WP_Query($args); $output = ""; $output .= "<table class='display' id='dt'>"; $output .= "<thead>"; $output .= "<tr>\n <th>Date Uploaded</th>\n <th>File Name</th>\n <th>URL</th>\n <th>Type</th>\n <th>Uploaded By</th>\n </tr>"; $output .= "</thead>"; $output .= "<tbody>"; if ($query_client->have_posts()) { while ($query_client->have_posts()) { $query_client->the_post(); if (!isset($client_name)) { $clientName = get_category(); $output .= "<tr>"; $output .= "<td>" . $clientName . "</td>"; $output .= "<td><a href='" . get_bloginfo('url') . "/" . "clients/" . $clientName . "' target='_blank'>" . $clientName . " View</a></td>"; $output .= "</tr>"; } else { $c_opt_file = rwmb_meta("Cfile", "type=file"); $c_opt_author = rwmb_meta("uploaded_by"); $c_opt_type = rwmb_meta("type"); $c_opt_file_name = get_the_title(); $c_opt_date = get_the_date(); foreach ($c_opt_file as $c) { $c_file = esc_url($c["url"]); } $output .= "<tr>"; $output .= "<td>" . $c_opt_date . "</td>"; $output .= "<td>" . $c_opt_file_name . "</td>"; $output .= "<td><a href='" . $c_file . "' target='_blank'>" . $c_file . "</a></td>"; $output .= "<td>" . $c_opt_type . "</td>"; $output .= "<td>" . $c_opt_author . "</td>"; $output .= "</tr>"; } } } $output .= "</tbody>"; $output .= "<tfooter></tfooter>"; $output .= "</table>"; return $output; wp_reset_postdata(); }
function ajax_get_car_list() { $distance = $_POST['distance'] / 1000; $is_return = $_POST['return']; $date_pickup = $_POST['pickup_date']; $start_location_id = $_POST['start_id']; $end_location_id = $_POST['end_id']; $args = array('posts_per_page' => -1, 'post_type' => 'cars', 'post_status' => 'publish'); $car_html = ''; $query = new WP_Query($args); if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); $image = rwmb_meta('vbs_car-image', 'type=plupload_image&size=thumbnail'); foreach ($image as $img) { $src = $img['url']; } $cost = calculateCost(get_the_ID(), $distance, $date_pickup, $start_location_id, $end_location_id); if ($is_return == '1') { $cost = $cost * 2; } $car_html .= '<div class="car_data">'; $car_html .= '<div class="car_image"><img src="' . $src . '" /></div>'; $car_html .= '<div class="car_info_middle">'; $car_html .= '<h4 class="car_name">' . get_the_title() . '</h4>'; $car_html .= '<ul class="car_info"> <li><i class="fa fa-male"></i> ' . rwmb_meta('vbs_passengers') . '</li> <li><i class="fa fa-suitcase"></i> ' . rwmb_meta('vbs_luggage') . '</li> <li><i class="fa fa-briefcase"></i> ' . rwmb_meta('vbs_handbag') . '</li> <li><i class="fa fa-child"></i> ' . rwmb_meta('vbs_child_seats') . '</li> </ul>'; $car_html .= '</div>'; $car_html .= '<div class="car_info_right"><h1 class="car_cost"><span class="currency">€</span><span class="cost">' . round($cost, 2) . '</span></h1>'; $car_html .= '<input class="selection" type="radio" data-id="' . get_the_ID() . '" name="cost" value="' . round($cost, 2) . '" /> ' . __('Select', 'vbs') . '</div>'; $car_html .= '</div>'; } } wp_reset_query(); echo $car_html; exit; }
/** * Shortcode to display meta value * * @param $atts Array of shortcode attributes, same as rwmb_meta function, but has more "meta_key" parameter * @see rwmb_meta function below * * @return string */ function rwmb_meta_shortcode($atts) { $atts = wp_parse_args($atts, array('type' => 'text', 'post_id' => get_the_ID())); if (empty($atts['meta_key'])) { return ''; } $meta = rwmb_meta($atts['meta_key'], $atts, $atts['post_id']); // Get uploaded files info if (in_array($atts['type'], array('file', 'file_advanced'))) { $content = '<ul>'; foreach ($meta as $file) { $content .= sprintf('<li><a href="%s" title="%s">%s</a></li>', $file['url'], $file['title'], $file['name']); } $content .= '</ul>'; } elseif (in_array($atts['type'], array('image', 'plupload_image', 'thickbox_image', 'image_advanced'))) { $content = '<ul>'; foreach ($meta as $image) { // Link thumbnail to full size image? if (isset($atts['link']) && $atts['link']) { $content .= sprintf('<li><a href="%s" title="%s"><img src="%s" alt="%s" title="%s" /></a></li>', $image['full_url'], $image['title'], $image['url'], $image['alt'], $image['title']); } else { $content .= sprintf('<li><img src="%s" alt="%s" title="%s" /></li>', $image['url'], $image['alt'], $image['title']); } } $content .= '</ul>'; } elseif ('taxonomy' == $atts['type']) { $content = '<ul>'; foreach ($meta as $term) { $content .= sprintf('<li><a href="%s" title="%s">%s</a></li>', get_term_link($term, $atts['taxonomy']), $term->name, $term->name); } $content .= '</ul>'; } elseif (is_array($meta)) { $content = '<ul><li>' . implode('</li><li>', $meta) . '</li></ul>'; } else { $content = $meta; } return apply_filters(__FUNCTION__, $content); }
public function widget ($args, $instance) { echo $args["before_widget"]; if(!empty($instance["title"])) echo $args["before_title"] . apply_filters("widget_title", $instance["title"]) . $args["after_title"]; $testimonials = new WP_Query(array( "post_type" => "testimonials", "posts_per_page" => -1, "orderby" => "rand", )); if($testimonials->have_posts()) { echo "<ul id='testimonial-rotator'>"; while ($testimonials->have_posts()) { $testimonials->the_post(); ?> <li class="hide"> <div class="media"> <div class="media-left"> <img class="media-object img-circle" src="<? echo wp_get_attachment_image_src (get_post_thumbnail_id())[0]; ?>"/> </div> <div class="media-body inline"> <p>"<? echo rwmb_meta("testimonial_quote"); ?>"</p> </div> </div> </li> <? } echo "</ul>"; wp_reset_postdata(); } else echo "<p>Sorry, there are no testimonials to be displayed</p>"; echo $args["after_widget"]; }
<?php global $bpxl_goblog_options; ?> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <div class="post-box"> <?php if ($bpxl_goblog_options['bpxl_single_featured'] == '1') { $bpxl_standard_single = rwmb_meta('bpxl_standard_single_hide', $args = array('type' => 'checkbox'), $post->ID); if (empty($bpxl_standard_single)) { if (has_post_thumbnail()) { echo '<div class="single-post-type">'; the_post_thumbnail('featured', array('title' => '')); echo '</div>'; } } } // Post Header get_template_part('template-parts/post-header'); if ($bpxl_goblog_options['bpxl_single_post_meta'] == '1') { // Post Meta get_template_part('template-parts/post-meta'); } if ($bpxl_goblog_options['bpxl_share_buttons_pos'] == 'top') { // Post Share Buttons
} else { if (@$smof_data['shop_sidebar_pos'] == 'No Sidebar') { define('IS_FULLWIDTH', TRUE); } elseif (@$smof_data['shop_sidebar_pos'] == 'Left') { define('SIDEBAR_POS', 'left'); } else { define('SIDEBAR_POS', 'right'); } $shop_columns_qty_classes = array('2 columns' => 'columns-2', '3 columns' => 'columns-3', '4 columns' => 'columns-4', '5 columns' => 'columns-5'); if (@$smof_data['shop_columns_qty'] != '' and array_key_exists($smof_data['shop_columns_qty'], $shop_columns_qty_classes)) { define('COLUMNS_QTY_CLASS', $shop_columns_qty_classes[$smof_data['shop_columns_qty']]); } else { define('COLUMNS_QTY_CLASS', 'columns-4'); } } get_header(); if (is_shop()) { global $post; $shop_page_id = get_option('woocommerce_shop_page_id'); $post = get_post($shop_page_id, OBJECT); setup_postdata($post); if (in_array(rwmb_meta('us_titlebar'), array('', 'caption_only'))) { function us_woocommerce_dont_show_page_title() { return false; } add_filter('woocommerce_show_page_title', 'us_woocommerce_dont_show_page_title'); } get_template_part('templates/pagehead'); wp_reset_postdata(); }
<article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <header class="entry-header"> <?php $slides = rwmb_meta('thm_gallery_images', 'type=image_advanced'); ?> <?php $count = count($slides); ?> <?php if ($count > 0) { ?> <div id="blog-gallery-slider" class="carousel slide" data-ride="carousel"> <!-- Wrapper for slides --> <div class="carousel-inner"> <?php $slide_no = 1; ?> <?php foreach ($slides as $slide) { ?> <div class="item <?php
" title="<?php printf(esc_attr__('Permalink to %s', 'hm'), the_title_attribute('echo=0')); ?> " rel="bookmark"><?php the_title(); ?> </a></h3> <hr class="dashed" /> </div> </header> <?php if (of_get_option('enable_post_featured') == 'true') { $post_video = rwmb_meta('hmmb_video_external', 'type=text'); if (empty($post_video)) { unset($img); if (current_theme_supports('post-thumbnails') && has_post_thumbnail()) { $customloop_thumb_image_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full'); $url = $customloop_thumb_image_url[0]; ?> <?php if (has_post_thumbnail()) { ?> <figure class="responsive add-bottom" data-media="<?php echo get_template_directory_uri(); ?> /inc/timthumb.php?src=<?php echo $url; ?>
<div class="fb-post" data-href="<?php if ($bpxl_status != '') { echo $bpxl_status; } ?> " data-width="735"></div> </div> <?php } } ?> <?php } ?> <?php $bpxl_status_excerpt_home = rwmb_meta('bpxl_status_excerpt_home', $args = array('type' => 'checkbox'), $post->ID); if (empty($bpxl_status_excerpt_home)) { ?> <div class="post-inner"> <div class="post-content"> <?php $excerpt_length = $bpxl_goblog_options['bpxl_excerpt_length']; if ($bpxl_goblog_options['bpxl_home_content'] == '2') { the_content(__('Read More', 'bloompixel')); } else { echo excerpt($excerpt_length); ?> <div class="read-more"> <a href="<?php the_permalink(); ?>
function widget($args, $instance) { global $post; extract($args); // Widget Options $title = apply_filters('widget_title', $instance['title']); // Title $post_id = $instance['post_id']; // Post ID echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } $infocus_post = get_post($post_id); ?> <div class="infocus-item"> <?php $post_title = $infocus_post->post_title; $post_permalink = get_post_permalink($infocus_post); $thumb_image = rwmb_meta('sf_thumbnail_image', 'type=image&size=full', $post_id); $thumb_video = get_post_meta($post_id, 'sf_thumbnail_video_url', true); foreach ($thumb_image as $detail_image) { $thumb_img_url = $detail_image['url']; break; } if (!$thumb_image) { $thumb_image = get_post_thumbnail_id($post_id); $thumb_img_url = wp_get_attachment_url($thumb_image, 'full'); } $image = aq_resize($thumb_img_url, 300, 225, true, false); ?> <figure> <?php if ($thumb_video != "") { ?> <?php echo video_embed($thumb_video, 300, 200); ?> <?php } else { if ($image) { ?> <a href="<?php echo $post_permalink; ?> " class="infocus-image"> <div class="overlay"> <div class="thumb-info"> <i class="icon-file-alt"></i> </div> </div> <img src="<?php echo $image[0]; ?> " width="<?php echo $image[1]; ?> " height="<?php echo $image[2]; ?> " /> </a> <?php } } ?> </figure> <div class="infocus-title clearfix"> <h5><a href="<?php echo $post_permalink; ?> " title="<?php echo $post_title; ?> "><?php echo $post_title; ?> </a></h5> <div class="comments-likes"> <?php if (function_exists('lip_love_it_link')) { echo lip_love_it_link($post_id, '<i class="icon-heart"></i>', '<i class="icon-heart"></i>', false); } ?> </div> </div> </div> <?php echo $after_widget; }
public function content($atts, $content = null) { $title = $order = $text_size = $items = $el_class = $width = $el_position = ''; extract(shortcode_atts(array('title' => '', 'text_size' => '', 'item_count' => '', 'order' => '', 'category' => 'all', 'animation' => 'fade', 'autoplay' => 'yes', 'el_class' => '', 'alt_background' => 'none', 'el_position' => '', 'width' => '1/1'), $atts)); $output = ''; // CATEGORY SLUG MODIFICATION if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); // TESTIMONIAL QUERY SETUP global $post, $wp_query; $paged = get_query_var('paged') ? get_query_var('paged') : 1; $testimonials_args = array('orderby' => $order, 'post_type' => 'testimonials', 'post_status' => 'publish', 'paged' => $paged, 'testimonials-category' => $category_slug, 'posts_per_page' => $item_count, 'no_found_rows' => 1); $testimonials = new WP_Query($testimonials_args); if ($autoplay == "yes") { $items .= '<div class="flexslider testimonials-slider content-slider" data-animation="' . $animation . '" data-autoplay="yes"><ul class="slides">'; } else { $items .= '<div class="flexslider testimonials-slider content-slider" data-animation="' . $animation . '" data-autoplay="no"><ul class="slides">'; } // TESTIMONIAL LOOP while ($testimonials->have_posts()) { $testimonials->the_post(); $testimonial_text = get_the_content(); $testimonial_cite = sf_get_post_meta($post->ID, 'sf_testimonial_cite', true); $testimonial_cite_subtext = sf_get_post_meta($post->ID, 'sf_testimonial_cite_subtext', true); $testimonial_image = rwmb_meta('sf_testimonial_cite_image', 'type=image', $post->ID); foreach ($testimonial_image as $detail_image) { $testimonial_image_url = $detail_image['url']; break; } if (!$testimonial_image) { $testimonial_image = get_post_thumbnail_id(); $testimonial_image_url = wp_get_attachment_url($testimonial_image, 'full'); } $testimonial_image = sf_aq_resize($testimonial_image_url, 70, 70, true, false); $items .= '<li class="testimonial">'; $items .= '<div class="testimonial-text text-' . $text_size . '">' . do_shortcode($testimonial_text) . '</div>'; if ($testimonial_image) { $items .= '<div class="testimonial-cite has-image">'; $items .= '<img src="' . $testimonial_image[0] . '" width="' . $testimonial_image[1] . '" height="' . $testimonial_image[2] . '" alt="' . $testimonial_cite . '" />'; if ($testimonial_cite_subtext != "") { $items .= '<cite>' . $testimonial_cite . '<span>' . $testimonial_cite_subtext . '</span></cite>'; } else { $items .= '<cite>' . $testimonial_cite . '</cite>'; } } else { $items .= '<div class="testimonial-cite">'; if ($testimonial_cite_subtext != "") { $items .= '<cite>' . $testimonial_cite . '<span>' . $testimonial_cite_subtext . '</span></cite>'; } else { $items .= '<cite>' . $testimonial_cite . '</cite>'; } } $items .= '</div>'; $items .= '</li>'; } wp_reset_postdata(); $items .= '</ul></div>'; $el_class = $this->getExtraClass($el_class); $width = spb_translateColumnWidthToSpan($width); $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true); $sidebars = ''; if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") { $sidebars = 'one-sidebar'; } else { if ($sidebar_config == "both-sidebars") { $sidebars = 'both-sidebars'; } else { $sidebars = 'no-sidebars'; } } $el_class .= ' testimonial'; // Full width setup $fullwidth = false; if ($alt_background != "none") { $fullwidth = true; } $output .= "\n\t" . '<div class="spb_testimonial_slider_widget spb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb_wrapper slider-wrap">'; $output .= $title != '' ? "\n\t\t\t" . '<div class="heading-wrap"><h3 class="spb-heading spb-center-heading"><span>' . $title . '</span></h3></div>' : ''; $output .= "\n\t\t\t" . $items; $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper'); $output .= "\n\t" . '</div> ' . $this->endBlockComment($width); $output = $this->startRow($el_position, $width, $fullwidth, false, $alt_background) . $output . $this->endRow($el_position, $width, $fullwidth, false); global $sf_include_carousel; $sf_include_carousel = true; return $output; }
public function content($atts, $content = null) { $title = $order = $page_link = $items = $item_class = $el_class = $width = $el_position = ''; extract(shortcode_atts(array('title' => '', 'item_count' => '-1', 'order' => '', 'category' => 'all', 'pagination' => 'no', 'page_link' => '', 'el_class' => '', 'el_position' => '', 'width' => '1/2'), $atts)); $output = ''; // CATEGORY SLUG MODIFICATION if ($category == "All") { $category = "all"; } if ($category == "all") { $category = ''; } $category_slug = str_replace('_', '-', $category); // TESTIMONIAL QUERY SETUP global $post, $wp_query, $sf_carouselID; if ($sf_carouselID == "") { $sf_carouselID = 1; } else { $sf_carouselID++; } $paged = get_query_var('paged') ? get_query_var('paged') : 1; $testimonials_args = array('orderby' => $order, 'post_type' => 'testimonials', 'post_status' => 'publish', 'paged' => $paged, 'testimonials-category' => $category_slug, 'posts_per_page' => $item_count, 'no_found_rows' => 1); $testimonials = new WP_Query($testimonials_args); $sidebar_config = sf_get_post_meta(get_the_ID(), 'sf_sidebar_config', true); $sidebars = ''; if ($sidebar_config == "left-sidebar" || $sidebar_config == "right-sidebar") { $sidebars = 'one-sidebar'; } else { if ($sidebar_config == "both-sidebars") { $sidebars = 'both-sidebars'; } else { $sidebars = 'no-sidebars'; } } global $column_width; if ($column_width != "") { if ($column_width == "1/1") { if ($sidebars == "both-sidebars") { $item_class = "span6"; } else { if ($sidebars == "one-sidebar") { $item_class = "span8"; } else { $item_class = "span12"; } } } else { if ($column_width == "1/2") { if ($sidebars == "both-sidebars") { $item_class = "span3"; } else { if ($sidebars == "one-sidebar") { $item_class = "span4"; } else { $item_class = "span6"; } } } else { if ($column_width == "3/4") { if ($sidebars == "both-sidebars") { $item_class = "span-bs-threequarter"; } else { if ($sidebars == "one-sidebar") { $item_class = "span6"; } else { $item_class = "span9"; } } } else { if ($column_width == "1/4") { if ($sidebars == "both-sidebars") { $item_class = "span-bs-quarter"; } else { if ($sidebars == "one-sidebar") { $item_class = "span2"; } else { $item_class = "span3"; } } } } } } } else { if ($width == "1/1") { if ($sidebars == "both-sidebars") { $item_class = "span6"; } else { if ($sidebars == "one-sidebar") { $item_class = "span8"; } else { $item_class = "span12"; } } } else { if ($width == "1/2") { if ($sidebars == "both-sidebars") { $item_class = "span3"; } else { if ($sidebars == "one-sidebar") { $item_class = "span4"; } else { $item_class = "span6"; } } } else { if ($width == "3/4") { if ($sidebars == "both-sidebars") { $item_class = "span-bs-threequarter"; } else { if ($sidebars == "one-sidebar") { $item_class = "span6"; } else { $item_class = "span9"; } } } else { if ($width == "1/4") { if ($sidebars == "both-sidebars") { $item_class = "span-bs-quarter"; } else { if ($sidebars == "one-sidebar") { $item_class = "span2"; } else { $item_class = "span3"; } } } } } } } $items .= '<div class="carousel-overflow"><ul id="carousel-' . $sf_carouselID . '" class="testimonials carousel-items clearfix" data-columns="1" data-auto="false">'; // TESTIMONIAL LOOP while ($testimonials->have_posts()) { $testimonials->the_post(); $testimonial_text = get_the_content(); $testimonial_cite = sf_get_post_meta($post->ID, 'sf_testimonial_cite', true); $testimonial_cite_subtext = sf_get_post_meta($post->ID, 'sf_testimonial_cite_subtext', true); $testimonial_image = rwmb_meta('sf_testimonial_cite_image', 'type=image', $post->ID); foreach ($testimonial_image as $detail_image) { $testimonial_image_url = $detail_image['url']; break; } if (!$testimonial_image) { $testimonial_image = get_post_thumbnail_id(); $testimonial_image_url = wp_get_attachment_url($testimonial_image, 'full'); } $testimonial_image = sf_aq_resize($testimonial_image_url, 70, 70, true, false); $items .= '<li class="testimonial carousel-item ' . $item_class . ' clearfix">'; $items .= '<div class="testimonial-text">' . do_shortcode($testimonial_text) . '</div>'; $items .= '<div class="testimonial-cite">'; if ($testimonial_image) { $items .= '<img src="' . $testimonial_image[0] . '" width="' . $testimonial_image[1] . '" height="' . $testimonial_image[2] . '" alt="' . $testimonial_cite . '" />'; $items .= '<div class="cite-text has-cite-image"><span class="cite-name">' . $testimonial_cite . '</span><span>' . $testimonial_cite_subtext . '</span></div>'; } else { $items .= '<div class="cite-text"><span class="cite-name">' . $testimonial_cite . '</span><span>' . $testimonial_cite_subtext . '</span></div>'; } $items .= '</div>'; $items .= '</li>'; } wp_reset_postdata(); $items .= '</ul>'; $items .= '<a href="#" class="prev"><i class="ss-navigateleft"></i></a><a href="#" class="next"><i class="ss-navigateright"></i></a>'; $options = get_option('sf_dante_options'); if ($options['enable_swipe_indicators']) { $items .= '<div class="sf-swipe-indicator"></div>'; } $items .= '</div>'; if ($page_link == "yes") { $options = get_option('sf_dante_options'); $testimonials_page = __($options['testimonial_page'], 'swiftframework'); if ($testimonials_page) { $items .= '<a href="' . get_permalink($testimonials_page) . '" class="read-more">' . __("More", "swiftframework") . '<i class="ssnavigate-right"></i></a>'; } } $width = spb_translateColumnWidthToSpan($width); $el_class = $this->getExtraClass($el_class); $el_class .= ' testimonial'; $output .= "\n\t" . '<div class="spb_testimonial_carousel_widget spb_content_element ' . $width . $el_class . '">'; $output .= "\n\t\t" . '<div class="spb_wrapper carousel-wrap">'; if ($title != '') { $output .= "\n\t\t\t" . '<h3 class="spb-heading"><span>' . $title . '</span></h3>'; } $output .= "\n\t\t\t\t" . $items; $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.spb_wrapper'); $output .= "\n\t" . '</div> ' . $this->endBlockComment($width); $output = $this->startRow($el_position) . $output . $this->endRow($el_position); global $sf_include_carousel, $sf_include_isotope; $sf_include_carousel = true; $sf_include_isotope = true; return $output; }
if(count($tabLogoProcess) > 0) { echo "<hr/>"; echo "<div>"; echo "<h2>Matching result : Logo process</h2>"; echo "<br/>"; foreach($tabLogoProcess as $logoProcess) { /////////////////////////////////////////////////// $tabImage = rwmb_meta( "PRODUCT_tab_image_process_" . ($j + 1), 'type=image&size=large' ); // print_r($tabImage); $i = 0; echo "<div class = 'cartouche-categorie' style = 'height:220px;'>"; // " . $tabLogoProcess[$j]['link'] . " echo "<a class = 'lienThumbnailCategory-1' href = '#'>"; foreach($tabImage as $image) { // echo $image['url'];
$more = 0; $img_size = 'fullwidth'; $brad_includes['load_bxslider'] = true; $ex_class = $brad_data['check_blogshare'] == true ? 'hide-border' : ''; $ex_class .= $brad_data['blog_align'] == "top" ? ' post-alignment-top' : ' post-alignment-bottom'; ?> <div id="post-<?php the_ID(); ?> " <?php post_class(' post-standard post-entries bg-style-' . $brad_data['grid_blog_style'] . ' maxwidth-' . $brad_data['blog_maxwidth'] . ' ' . $ex_class . ' clearfix '); ?> > <?php $images = rwmb_meta('brad_image_list', "type=image&size={$img_size}"); ?> <?php if ($brad_data['blog_align'] == 'top') { ?> <div class="post-upper text<?php echo $brad_data['blog_upper_align']; ?> "> <?php if ($brad_data['check_blog_date'] || $brad_data['check_blog_categories'] || is_sticky($post->ID)) { ?> <div class="post-meta-data style2"> <?php if (is_sticky($post->ID)) { echo '<span class="sticky-post">' . __('Sticky Post', 'brad') . '</span>';
function editit_show_event_calendar() { //Get Post Date $year = isset($_POST['year']) ? $_POST['year'] : date('Y'); $month = isset($_POST['month']) ? $_POST['month'] : date('m'); //Set FirstDate&LastDate (ex. 2014-01-01,2014.01.31) $year_month_firstday = $year . '-' . $month . '-01'; $year_month_lastday = date("Y-m-t", strtotime($year_month_firstday)); //Query Set $args = array('post_type' => 'event', 'post_status' => 'publish', 'posts_per_page' => '-1', 'meta_query' => array(array('key' => 'editit_dateeventstartdate', 'value' => $year_month_lastday, 'compare' => '<=', 'type' => 'DATE'), array('key' => 'editit_dateeventenddate', 'value' => $year_month_firstday, 'compare' => '>=', 'type' => 'DATE'))); //Set Category Query $selectedcategories = rwmb_meta('editit_selecteventcategory'); if ($selectedcategories && $selectedcategories[0] == 0) { unset($selectedcategories[0]); } if ($selectedcategories) { $args['tax_query'][] = array('taxonomy' => 'event_category', 'field' => 'ID', 'terms' => $selectedcategories); } $wp_query = new WP_Query($args); while ($wp_query->have_posts()) { $wp_query->the_post(); // 開始日が空欄なら投稿日セット $post_date = get_the_time('Y-m-d'); $start_date = rwmb_meta('editit_dateeventstartdate'); $end_date = rwmb_meta('editit_dateeventenddate'); // 開始日、終了日が空欄なら投稿日セット $start_date = isset($start_date) ? $start_date : $post_date; $end_date = isset($end_date) ? $end_date : $post_date; // 日付を表示用に整形 $start_date = new DateTime($start_date); $start_date = $start_date->format('Y-m-d'); $end_date = new DateTime($end_date); $end_date = $end_date->format('Y-m-d'); // 終了日が開始日より前なら終了日に開始日をセット if ($start_date > $end_date) { $end_date = $start_date; } // 表示html組み立て // 詳細有 if (rwmb_meta('editit_selecteventlinktosinglepage')) { $html = "<span>● <a href='" . get_permalink() . "'>" . get_the_title() . "</a></span>"; } else { // 詳細無 // URL有 if (rwmb_meta('editit_urleventlinkurl') != '') { $html = "<span>● <a href='" . rwmb_meta("editit_urleventlinkurl") . "' target='_blank'>" . get_the_title() . "</a></span>"; } else { // URL無 $html = "<span>● " . get_the_title() . "</span>"; } } //開始と終了が同じ if ($start_date == $end_date) { $start_date = new DateTime($start_date); $eventdate = $start_date->format('m-d-Y'); $jsondata[$eventdate] .= $html; } else { $interval = new DateInterval('P1D'); // 7日間隔 $start_date = new DateTime($start_date); $end_date = new DateTime($end_date); $end_date = $end_date->modify('+1 day'); foreach (new DatePeriod($start_date, $interval, $end_date) as $d) { $eventdate = $d->format("m-d-Y"); $jsondata[$eventdate] .= $html; } } } return $jsondata; }