当前位置: 首页>>代码示例>>PHP>>正文


PHP javo_str_cut函数代码示例

本文整理汇总了PHP中javo_str_cut函数的典型用法代码示例。如果您正苦于以下问题:PHP javo_str_cut函数的具体用法?PHP javo_str_cut怎么用?PHP javo_str_cut使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了javo_str_cut函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: jv_claim_columns_function

    static function jv_claim_columns_function($columns_name, $post_id)
    {
        switch ($columns_name) {
            case 'username':
                echo get_post_meta($post_id, 'user_login', true);
                break;
            case 'email':
                echo get_post_meta($post_id, 'email', true);
                break;
            case 'phone':
                echo get_post_meta($post_id, 'phone', true);
                break;
            case 'content':
                echo javo_str_cut(get_post($post_id)->post_content, 80);
                break;
            case 'status':
                echo get_post_meta($post_id, 'approve', true) != 'approved' ? sprintf('<a
					class="button button-primary javo-claim-app"
					data-post-id="%s"
					data-user-login="%s"
					data-user-name="%s"
					data-user-email="%s"
					href="#">%s</a>', $post_id, get_post_meta($post_id, 'user_login', true), get_post_meta($post_id, 'user_name', true), get_post_meta($post_id, 'email', true), __('Approve', 'javo_fr')) : __('Approved', 'javo_fr');
                break;
            case 'item-name':
                $parent_post_id = get_post_meta($post_id, 'parent_post_id', true);
                printf('<a href="%s">%s</a>', get_permalink($parent_post_id), get_post($parent_post_id)->post_title);
                break;
        }
    }
开发者ID:redcypress,项目名称:lacecake,代码行数:30,代码来源:edit-post-list-column.php

示例2: __excerpt

 public function __excerpt($length = 120, $html = false)
 {
     $javo__excerpt = javo_str_cut(strip_tags($this->post->post_content), (int) $length);
     if ($html) {
         $javo__excerpt = sprintf('<a href="%s" target="_self">%s</a>', get_permalink($this->post->ID), $javo__excerpt);
     }
     return $javo__excerpt;
 }
开发者ID:redcypress,项目名称:lacecake,代码行数:8,代码来源:javo-post-class.php

示例3: the_excerpt

				<?php 
if (is_search()) {
    // Only display Excerpts for Search
    ?>
					<div class="entry-summary">
						<?php 
    the_excerpt();
    ?>
					</div><!-- .entry-summary -->
				<?php 
} else {
    ?>
					<div class="entry-content">
						<?php 
    if (is_category()) {
        printf('<a href="%s">%s</a>', get_permalink(), javo_str_cut(get_the_excerpt(), 300));
    } else {
        the_content(__('Continue reading <span class="meta-nav">&rarr;</span>', 'javo_fr'));
    }
    ?>

						<?php 
    wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'javo_fr'), 'after' => '</div>'));
    ?>
					</div><!-- .entry-content -->
				<?php 
}
?>
			</div><!-- 12 Columns Close -->
		</div><!-- Row Close -->
		<footer class="entry-meta">
开发者ID:kaiifalcutela,项目名称:eatdk,代码行数:31,代码来源:content.php

示例4: get_posts

// Queries Loop
$javo_this_posts = get_posts($javo_this_posts_args);
foreach ($javo_this_posts as $post) {
    setup_postdata($post);
    $javo_meta_query = new javo_get_meta($post->ID);
    $javo_latlng = @unserialize($javo_meta_query->_get('latlng', array()));
    $javo_latlng = new javo_ARRAY($javo_latlng);
    $javo_set_icon = '';
    $javo_marker_term_id = wp_get_post_terms($post->ID, 'item_category');
    if (!empty($javo_marker_term_id)) {
        $javo_set_icon = get_option('javo_item_category_' . $javo_marker_term_id[0]->term_id . '_marker', '');
        if ($javo_set_icon == '') {
            $javo_set_icon = $javo_tso->get('map_marker', '');
        }
    }
    $javo_this_return[$post->ID] = array('post_title' => $post->post_title, 'contents' => javo_str_cut($post->content, 300), 'thumbnail' => get_the_post_thumbnail($post->ID, array(50, 50)), 'permalink' => get_permalink($post->ID), 'category' => $javo_meta_query->cat('item_category', __('No Category', 'javo_fr')), 'location' => $javo_meta_query->cat('item_location', __('No Location', 'javo_fr')), 'lat' => $javo_latlng->get('lat'), 'lng' => $javo_latlng->get('lng'), 'icon' => $javo_set_icon, 'phone' => $javo_meta_query->get('phone'), 'address' => $javo_meta_query->get('address'), 'mobile' => $javo_meta_query->get('mobile'), 'website' => $javo_meta_query->get('website'), 'email' => $javo_meta_query->get('email'), 'rating' => $javo_meta_query->get_child_count('ratings'), 'review' => $javo_meta_query->get_child_count('review'));
}
wp_reset_postdata();
?>

<!-- Javo Map Options -->
<fieldset class="hidden">
	<input type="hidden" javo-map-distance-unit value="<?php 
echo $javo_tso_map->get('distance_unit', __('km', 'javo_fr'));
?>
">
	<input type="hidden" javo-map-distance-max value="<?php 
echo (double) $javo_tso_map->get('distance_max', '500');
?>
">
	<input type="hidden" javo-map-read-more value="<?php 
开发者ID:redcypress,项目名称:lacecake,代码行数:31,代码来源:tp-javo-map-wide.php

示例5: the_permalink

					<!-- ./pull-left -->
					<a href="<?php 
the_permalink();
?>
">
						<?php 
if (has_post_thumbnail()) {
    the_post_thumbnail('javo-tiny', array('class' => 'javo-rotate-back-image'));
} else {
    printf('<img src="%s" style="width:80px; height:80px;" class="javo-rotate-back-image">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
}
?>
						<div class="row javo-rotate-inner-content">
							<div class="col-md-12">
								<?php 
$javo_this_content = javo_str_cut(get_the_excerpt(), 195);
echo $javo_this_content != "" ? $javo_this_content : __('No Content', 'javo_fr');
?>
							</div>
							<!-- /.col-md-12 -->
						</div>
						<!-- /.row -->
					</a>
						<span class="javo-sns-wrap social-wrap">
							<i class="sns-facebook" data-title="<?php 
the_title();
?>
" data-url="<?php 
the_permalink();
?>
">
开发者ID:prosenjit-itobuz,项目名称:upages,代码行数:31,代码来源:content-archive-grid.php

示例6: wp_get_attachment_image_src

            }
            if ('' === ($javo_set_icon = get_option("javo_item_category_{$javo_this_terms[0]}_marker", ''))) {
                $javo_set_icon = $javo_tso->get('map_marker', '');
            }
            $javo_this_thumb = '';
            if ('' !== ($javo_this_thumb_id = get_post_thumbnail_id($post->ID))) {
                $javo_this_thumb_url = wp_get_attachment_image_src($javo_this_thumb_id, 'javo-map-thumbnail');
                if (isset($javo_this_thumb_url)) {
                    $javo_this_thumb = $javo_this_thumb_url[0];
                }
            }
            // If not found this post a thaumbnail
            if (empty($javo_this_thumb)) {
                $javo_this_thumb = $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png');
            }
            $javo_relative_items[] = array('lat' => get_post_meta($post->ID, 'jv_item_lat', true), 'lng' => get_post_meta($post->ID, 'jv_item_lng', true), 'icon' => $javo_set_icon, 'thumbnail' => $javo_this_thumb, 'post_title' => wp_trim_words($post->post_title, 30), 'permalink' => apply_filters('javo_wpml_link', $post->ID), 'address' => javo_str_cut(get_post_meta($post->ID, 'jv_item_address', true), 25), 'mobile' => javo_str_cut(get_post_meta($post->ID, 'jv_item_mobile', true), 25), 'website' => javo_str_cut(get_post_meta($post->ID, 'jv_item_website', true), 25), 'email' => javo_str_cut(get_post_meta($post->ID, 'jv_item_email', true), 25), 'category' => javo_str_cut(get_term($javo_this_terms[0], 'item_category')->name, 25), 'location' => $javo_this_location);
        }
        // End Foreach
        wp_reset_postdata();
    }
    // End If
    ?>
<fieldset>
	<input type="hidden" value="<?php 
    echo $javo_tso->get('javo_single_map_style');
    ?>
" data-javo-map-none-style>
	<input type="hidden" value="<?php 
    echo $javo_tso->get('single_map_marker', null);
    ?>
" data-javo-map-single-marker>
开发者ID:kaiifalcutela,项目名称:eatdk,代码行数:31,代码来源:single-item-tab.php

示例7: javo_map_get_favorite_lists_callback

function javo_map_get_favorite_lists_callback()
{
    ob_start();
    if (is_user_logged_in()) {
        $javo_this_current_user_favorites = get_user_meta(get_current_user_id(), 'favorites', true);
        ?>
		<div class="alert alert-rectangle alert-dark alert-no-padding">
			<h3 class="javo-sidebar-title text-center"><?php 
        _e('My Favorites', 'javo_fr');
        ?>
</h3>
		</div>

		<!-- Todo: Insert Sidebar content here. XD -->
		<ul class="list-group">
			<?php 
        if (!empty($javo_this_current_user_favorites)) {
            foreach ($javo_this_current_user_favorites as $favorite) {
                if (!empty($favorite['post_id'])) {
                    $javo_this_post = get_post($favorite['post_id']);
                    if ($javo_this_post == null) {
                        continue;
                    }
                    printf('<li class="list-group-item javo-hmap-marker-trigger text-center" data-id="mid_%s" data-post-id="%s"><span class="glyphicon glyphicon-heart-empty"></span>%s</li>', $javo_this_post->ID, $javo_this_post->ID, javo_str_cut($javo_this_post->post_title, 23));
                }
            }
            // End foreach
        }
        // End if
        ?>
		</ul>
		<?php 
    } else {
        ?>
		<div class="well well-default">
			<strong><?php 
        _e('Alert', 'javo_fr');
        ?>
</strong>
			<p><?php 
        _e('Please login', 'javo_fr');
        ?>
</p>
		</div>
		<?php 
    }
    $javo_this_output = ob_get_clean();
    echo json_encode(array('html' => $javo_this_output));
    exit;
}
开发者ID:ksingh812,项目名称:epb,代码行数:50,代码来源:list-main-map.php

示例8: events_func

    public static function events_func($atts, $content = "")
    {
        global $javo_custom_item_label, $javo_tso;
        extract(shortcode_atts(array('title' => '', 'sub_title' => '', 'title_text_color' => '#000', 'sub_title_text_color' => '#000', 'line_color' => '#fff', 'category' => '', 'page' => (int) 4, 'order' => 'DESC', 'type' => 'single', 'nopaging' => true), $atts));
        $javo_events_args = array('post_type' => 'jv_events', 'post_status' => 'publish', 'posts_per_page' => $page > 0 ? $page : -1, 'order' => $order, 'orderby' => 'post_date');
        if ($category != '') {
            $javo_events_args['tax_query'][] = array('taxonomy' => 'jv_events_category', 'field' => 'term_id', 'terms' => $category);
        }
        $javo_events = new WP_Query($javo_events_args);
        ob_start();
        echo apply_filters('javo_shortcode_title', $title, $sub_title, array('title' => 'color:' . $title_text_color . ';', 'subtitle' => 'color:' . $sub_title_text_color . ';', 'line' => 'border-color:' . $line_color . ';'));
        ?>
		<div class="sc-wrap" id="javo-sc-events-listing">
			<div class="sc-items sc-item-long-line-box">
				<div class='row'>
					<?php 
        switch ($type) {
            case 'single':
                ?>
							<div class="javo-event-item-slider single-event-col">
								<div class="row">
									<div class="col-md-offset-9 col-md-3">
										<!-- Controls -->
										<div class="controls pull-right hidden-xs">
											<a class="left fa fa-chevron-left btn btn-success btn-circle btn-white" href="#javo-event-item-slider-container" data-slide="prev"></a>
											<a class="right fa fa-chevron-right btn btn-success btn-circle btn-white" href="#javo-event-item-slider-container" data-slide="next"></a>
										</div>
									</div>
								</div>
								<div id="javo-event-item-slider-container" class="carousel slide" data-ride="carousel">
									<!-- Wrapper for slides -->
									<div class="carousel-inner">
										<?php 
                $javo_active = ' active';
                $javo_events = new WP_Query($javo_events_args);
                if ($javo_events->have_posts()) {
                    while ($javo_events->have_posts()) {
                        $javo_events->the_post();
                        $javo_get_parent_id = (int) get_post_meta(get_the_ID(), 'parent_post_id', true);
                        $javo_get_parent = get_post($javo_get_parent_id);
                        if ($javo_get_parent == '') {
                            continue;
                        }
                        $javo_get_parent_url = apply_filters('javo_wpml_link', $javo_get_parent->ID) . '#item-event';
                        ?>
												<div class="item<?php 
                        echo $javo_active;
                        ?>
">
													<div class="col-sm-12 pull-left">
														<div class="row">
															<div class="col-md-12 text-center">
																<div class="javo-shortcode-event-listing one-col-event">
																	<?php 
                        if (has_post_thumbnail()) {
                            the_post_thumbnail('javo-box', array('class' => 'img-responsive'));
                        } else {
                            printf('<img src="%s" class="img-circle" style="width:100%%; height:246px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
                        }
                        ?>
																	<div class="javo-event-one-col">
																		<a href="<?php 
                        echo $javo_get_parent_url;
                        ?>
">
																			<?php 
                        echo $javo_get_parent->post_title;
                        ?>
																			<div class="offer">
																				<?php 
                        the_title();
                        ?>
<br/>
																			</div>
																			<div class="javo-event-one-col-content">
																				<?php 
                        echo javo_str_cut(get_the_excerpt(), 400);
                        ?>
																			</div><!-- events-content-->
																		</a>
																	</div> <!-- javo-shop-name-->
																</div><!-- javo-shortcode-event-listing-->
															</div>
														</div><!-- /.row -->
													</div><!-- /.col-md-12 -->
												</div><!-- /.item -->
												<?php 
                        $javo_active = null;
                        // End While
                    }
                    // ENd If
                }
                wp_reset_query();
                ?>
									</div>
								</div>
							</div>
							<?php 
                break;
            default:
//.........这里部分代码省略.........
开发者ID:kaiifalcutela,项目名称:eatdk,代码行数:101,代码来源:javo-events.php

示例9: rating_list_function

function rating_list_function($atts, $content = '')
{
    global $javo_tso;
    wp_enqueue_style('javo-rating-list-css', JAVO_THEME_DIR . '/library/shortcodes/rating-list/javo-rating-list.css', '1.0');
    extract(shortcode_atts(array('title' => '', 'sub_title' => '', 'title_text_color' => '#000', 'sub_title_text_color' => '#000', 'line_color' => '#fff', 'count' => 5), $atts));
    $javo_this_ratings_args = array('post_type' => 'item', 'post_status' => 'publish', 'posts_per_page' => $count, 'orderby' => 'meta_value', 'meta_key' => 'rating_average');
    ob_start();
    echo apply_filters('javo_shortcode_title', $title, $sub_title, array('title' => 'color:' . $title_text_color . ';', 'subtitle' => 'color:' . $sub_title_text_color . ';', 'line' => 'border-color:' . $line_color . ';'));
    ?>
	<div class="javo-rating-list-wrap">
		<?php 
    $javo_this_ratings = new WP_Query($javo_this_ratings_args);
    if ($javo_this_ratings->have_posts()) {
        $i = 1;
        while ($javo_this_ratings->have_posts()) {
            $javo_this_ratings->the_post();
            $javo_this_score = (double) get_post_meta(get_the_ID(), 'rating_average', true);
            $javo_meta_query = new javo_GET_META(get_the_ID());
            $rating_raniking_num = $i++;
            ?>
				<div class="row rating_list top-ranker">
					<div class="col-md-3 top-ratings-thumb">
						<a href="<?php 
            the_permalink();
            ?>
.#item-ratings">
							<?php 
            if (has_post_thumbnail()) {
                the_post_thumbnail('thumbnail');
            } else {
                printf('<img src="%s" class="img-responsive wp-post-image img-circle" style="width:80px; height:80px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
            }
            ?>
						</a>
						<div class="top-ratings-num rating-num-<?php 
            echo $rating_raniking_num;
            ?>
"><?php 
            echo $rating_raniking_num;
            ?>
</div>
					</div>
					<div class="col-md-6 javo-p-t-20px">
						<a href="<?php 
            the_permalink();
            ?>
.#item-ratings">
							<h3><?php 
            echo javo_str_cut(get_the_title(), 20);
            ?>
</h3>
							<p><?php 
            printf('%s / %s', $javo_meta_query->cat('item_category', __('No category', 'javo_fr')), $javo_meta_query->cat('item_location', 'No Location'));
            ?>
</p>
						</a>
					</div>
					<div class="col-md-2 javo-p-t-20px">
						<div class="text-center">
							<?php 
            printf('<span class="rating_ave">%s</span> / <span class="rating_amount">%s</span>', $javo_this_score, $javo_meta_query->get_child_count('ratings', 'rating_parent_post_id'));
            ?>
						</div>
						<div class="javo-rating-registed-score" data-score="<?php 
            echo $javo_this_score;
            ?>
" title=<?php 
            _e("gorgeous", "javo_fr");
            ?>
></div>
					</div><!-- Col -->
				</div><!-- rating_list-imgs -->
				<?php 
        }
        // End While
    } else {
        _e('Not Items Found.', 'javo_fr');
    }
    // End If
    ?>
	</div>
	<?php 
    wp_reset_query();
    $content = ob_get_clean();
    return $content;
}
开发者ID:ksingh812,项目名称:epb,代码行数:86,代码来源:javo-rating-list.php

示例10: get_term_link

										<div class="sub-cat-wraps-wrap">
											<div class="sub-cat-wraps">
												<a href="<?php 
                echo get_term_link($term);
                ?>
">
													<h4 class="category-title"><?php 
                echo $term->name;
                ?>
<br><small><?php 
                printf('%s %s', __('in', 'javo_fr'), strtoupper($javo_this_terms_object->name));
                ?>
</small></h3>
													<blockquote>
														<footer><?php 
                echo javo_str_cut($term->description, 130);
                ?>
</footer>
													</blockquote>
												</a>
											</div> <!-- sub-cat-wraps -->
										</div> <!-- sub-cat-wraps-wrap -->
									</div>
									<?php 
            }
        }
    } else {
        printf('<div class="col-md-12 no-found-sub-categories"><h4>%s</h4></div>', __("Sub Categories not found", 'javo_fr'));
    }
    // End if
    ?>
开发者ID:ksingh812,项目名称:epb,代码行数:31,代码来源:archive.php

示例11: javo_events_gallery_function

    public static function javo_events_gallery_function($atts = array(), $content = "")
    {
        global $javo_tso;
        self::$load_script = true;
        extract(shortcode_atts(array('title' => '', 'sub_title' => '', 'title_text_color' => '#000', 'sub_title_text_color' => '#000', 'line_color' => '#fff', 'display_type' => 'parent'), $atts));
        $javo_this_gallery_args = array("post_type" => 'jv_events', "post_status" => 'publish', "posts_per_page" => -1);
        $javo_this_get_term_args = array();
        $javo_this_get_term_args['hide_empty'] = false;
        if ($display_type == 'parent' || $display_type == '') {
            $javo_this_get_term_args['parent'] = 0;
        }
        $javo_events_gallery_posts = new WP_Query($javo_this_gallery_args);
        $javo_events_gallery_terms = get_terms("jv_events_category", $javo_this_get_term_args);
        ob_start();
        echo apply_filters('javo_shortcode_title', $title, $sub_title, array('title' => 'color:' . $title_text_color . ';', 'subtitle' => 'color:' . $sub_title_text_color . ';', 'line' => 'border-color:' . $line_color . ';'));
        ?>
		<div id="javo-events-gall">
			<div class="javo-events-gallery-navi">
				<button class="javo-event-gallery-filter" data-filter="all"><?php 
        _e('ALL', 'javo_fr');
        ?>
</button>
				<?php 
        foreach ($javo_events_gallery_terms as $term) {
            printf('<button class="javo-event-gallery-filter gallery-terms-btn" data-filter=".javo-events-gallery-term-%s">%s</button>', $term->term_id, strtoupper($term->name));
        }
        ?>
			</div>
			<div class="javo-events-gallery row">
				<?php 
        if ($javo_events_gallery_posts->have_posts()) {
            while ($javo_events_gallery_posts->have_posts()) {
                $javo_events_gallery_posts->the_post();
                $javo_meta_query = new javo_GET_META(get_the_ID());
                $javo_this_parent_permalink = apply_filters('javo_wpml_link', get_post_meta(get_the_ID(), 'parent_post_id', true));
                $javo_this_parent_permalink .= "#item-events";
                $javo_this_include_terms = $javo_meta_query->cat('jv_events_category', false, false, true);
                $javo_this_terms = '';
                if ($javo_this_include_terms != false) {
                    foreach ($javo_this_include_terms as $terms) {
                        $javo_this_terms .= ' javo-events-gallery-term-' . $terms->term_id;
                    }
                } else {
                    $javo_this_terms = ' javo-events-gallery-term-all';
                }
                ?>
						<div class="col-md-3 javo-event-gallery-mix<?php 
                echo $javo_this_terms;
                ?>
">
							<a href="<?php 
                echo $javo_this_parent_permalink;
                ?>
">
								<?php 
                if (has_post_thumbnail()) {
                    echo get_the_post_thumbnail(get_the_ID(), 'javo-box');
                } else {
                    printf('<img src="%s" class="jv-events-gallery-no-image" style="width:100%%; height:266px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
                }
                ?>
							</a>
							<div class="javo-events-gallery-term-content-title"><span><?php 
                echo javo_str_cut(get_the_title(), 25);
                ?>
</span></div>

							<?php 
                if (get_post_meta(get_the_ID(), 'brand', true)) {
                    ?>
								<div class="event-tag custom-bg-color-setting admin-color-setting">
									<?php 
                    echo apply_filters('javo_offer_brand_tag', get_post_meta(get_the_ID(), 'brand', true));
                    ?>
								</div>
							<?php 
                }
                ?>
						</div>
						<?php 
            }
            // End While
        } else {
            _e('No Items Found.', 'javo_fr');
        }
        // End If
        wp_reset_query();
        ?>
				<div class="gap"></div>
				<div class="gap"></div>
			</div>
		</div>
		<script type="text/javascript">
		jQuery(function($){
			"use strict";
			$('.javo-events-gallery').mixItUp({
				selectors:{
					target		: '.javo-event-gallery-mix'
					, filter	: '.javo-event-gallery-filter'

//.........这里部分代码省略.........
开发者ID:kaiifalcutela,项目名称:eatdk,代码行数:101,代码来源:events-gallery.php

示例12: javo_map_callback

 static function javo_map_callback()
 {
     // Get Theme Settings
     global $javo_tso, $javo_tso_map, $javo_favorite;
     // Get Parameter of Queries
     $javo_query = new javo_array($_POST);
     // Setup Agrumnets
     $javo_this_posts_args = array('post_status' => 'publish', 'post_type' => $javo_query->get('post_type', 'post'), 'posts_per_page' => $javo_query->get('ppp', 10), 'paged' => (int) $javo_query->get('current', 1), 'order' => $javo_query->get('order', 'DESC'));
     // WPML
     if ($javo_query->get('lang', null) != null) {
         global $sitepress;
         if (!empty($sitepress)) {
             $sitepress->switch_lang($javo_query->get('lang'), true);
         }
     }
     // Apply Filter
     if ($javo_query->get('filter', null) != null) {
         if (is_Array($javo_query->get('filter'))) {
             foreach ($javo_query->get('filter') as $taxonomy => $terms) {
                 if (!empty($terms)) {
                     $javo_this_posts_args['tax_query']['relation'] = 'AND';
                     $javo_this_posts_args['tax_query'][] = array('taxonomy' => $taxonomy, 'field' => 'term_id', 'terms' => $terms);
                 }
             }
         }
     }
     // Set Keyword
     if ($javo_query->get('keyword', null) != null) {
         $javo_this_posts_args['s'] = $javo_query->get('keyword');
     }
     switch ($javo_query->get('panel', 'list')) {
         case 'featured':
             $javo_this_posts_args['meta_query']['relation'] = 'AND';
             $javo_this_posts_args['meta_query'][] = array('key' => 'javo_this_featured_item', 'compare' => '=', 'value' => 'use');
             break;
         case 'favorite':
             $javo_this_posts_args = array('post_type' => $javo_query->get('post_type', 'post'));
             $javo_this_user_favorite = (array) get_user_meta(get_current_user_id(), 'favorites', true);
             $javo_this_user_favorite_posts = array('0');
             if (!empty($javo_this_user_favorite)) {
                 foreach ($javo_this_user_favorite as $favorite) {
                     if (!empty($favorite['post_id'])) {
                         $javo_this_user_favorite_posts[] = $favorite['post_id'];
                     }
                 }
                 // End foreach
             }
             // End if
             $javo_this_posts_args['post__in'] = (array) $javo_this_user_favorite_posts;
             break;
         case 'list':
         default:
     }
     // Set Read More
     if ($javo_query->get('offset', null) != null) {
         $javo_this_posts_args['offset'] = $javo_query->get('offset');
     }
     // Return Variables
     $javo_this_return = array();
     // Queries Loop
     $javo_this_posts = new WP_Query($javo_this_posts_args);
     if ($javo_this_posts->have_posts()) {
         while ($javo_this_posts->have_posts()) {
             $javo_this_posts->the_post();
             $javo_meta_query = new javo_get_meta(get_the_ID());
             $javo_rating = new javo_RATING(get_the_ID());
             $javo_latlng = @unserialize($javo_meta_query->_get('latlng', array()));
             $javo_latlng = new javo_ARRAY($javo_latlng);
             $javo_set_icon = '';
             $javo_marker_term_id = wp_get_post_terms(get_the_ID(), 'item_category');
             if (!empty($javo_marker_term_id)) {
                 $javo_set_icon = get_option('javo_item_category_' . $javo_marker_term_id[0]->term_id . '_marker', '');
                 if ($javo_set_icon == '') {
                     $javo_set_icon = $javo_tso->get('map_marker', '');
                 }
             }
             $javo_this_thumbnail = get_the_post_thumbnail(get_the_ID(), array(50, 50));
             $javo_this_thumbnail = $javo_this_thumbnail != '' ? $javo_this_thumbnail : sprintf('<img src="%s" class="img-responsive wp-post-image" style="width:50px; height:50px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
             $javo_this_thumbnail_large = get_the_post_thumbnail(get_the_ID(), 'javo-box-v', array('class' => 'group list-group-image item-thumbs'));
             $javo_this_thumbnail_large = $javo_this_thumbnail_large != '' ? $javo_this_thumbnail_large : sprintf('<img src="%s" style="width:100%%; height:219px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
             $javo_this_author_avatar_id = get_the_author_meta('avatar');
             $javo_this_author_avatar = wp_get_attachment_image($javo_this_author_avatar_id, 'javo-tiny', true, array('class' => 'img-circle', 'style' => 'width:50px; height:50px;'));
             $javo_this_return[get_the_ID()] = array('post_title' => get_the_title(), 'contents' => javo_str_cut(strip_shortcodes(get_the_excerpt()), 300), 'thumbnail' => $javo_this_thumbnail, 'thumbnail_large' => $javo_this_thumbnail_large, 'avatar' => $javo_this_author_avatar, 'author_name' => get_the_author_meta('display_name'), 'permalink' => get_permalink(), 'category' => $javo_meta_query->cat('item_category', __('No Category', 'javo_fr')), 'location' => $javo_meta_query->cat('item_location', __('No Location', 'javo_fr')), 'favorite' => $javo_favorite->on(get_the_ID(), ' saved'), 'lat' => $javo_latlng->get('lat'), 'lng' => $javo_latlng->get('lng'), 'icon' => $javo_set_icon, 'phone' => $javo_meta_query->get('phone'), 'mobile' => $javo_meta_query->get('mobile'), 'website' => $javo_meta_query->get('website'), 'email' => $javo_meta_query->get('email'), 'address' => $javo_meta_query->get('address'), 'rating' => $javo_rating->parent_rating_average, 'rating_count' => $javo_meta_query->get_child_count('ratings'), 'review_count' => $javo_meta_query->get_child_count('review'));
         }
     }
     wp_reset_query();
     $javo_this_pagination = '';
     if ($javo_query->get('pagination') == 'read_more') {
         $javo_this_pagination = sprintf('<a class="btn btn-primary btn-block javo-wide-map-read-more">%s</a>', __('Read More', 'javo_fr'));
     } else {
         $javo_this_pagination = sprintf('<div class="javo_pagination">%s</div>', paginate_links(array('base' => "%_%", 'format' => '?%#%', 'current' => (int) $javo_query->get('current', 1), 'total' => $javo_this_posts->max_num_pages)));
     }
     echo json_encode(array('state' => 'success', 'result' => $javo_this_return, 'pagination' => $javo_this_pagination));
     exit;
 }
开发者ID:redcypress,项目名称:lacecake,代码行数:95,代码来源:callback-javo-map.php

示例13: time_line_ajax

    public function time_line_ajax()
    {
        $javo_query = new javo_array($_POST);
        $javo_ajax_timeline_args = array('post_type' => 'post', 'post_status' => 'publish', 'offset' => (int) $javo_query->get('offset'), 'posts_per_page' => (int) $javo_query->get('count'));
        $javo_item_timeline = new wp_query($javo_ajax_timeline_args);
        ob_start();
        if ($javo_item_timeline->have_posts()) {
            $i = 0;
            while ($javo_item_timeline->have_posts()) {
                $i++;
                $javo_item_timeline->the_post();
                switch ($i % 5) {
                    case 0:
                        $javo_badge = "warning";
                        break;
                    case 1:
                        $javo_badge = "danger";
                        break;
                    case 2:
                        $javo_badge = "primary";
                        break;
                    case 3:
                        $javo_badge = "info";
                        break;
                    case 4:
                        $javo_badge = "success";
                        break;
                    default:
                        $javo_badge = "";
                }
                ?>

				<li<?php 
                echo $i % 2 == 0 ? ' class="jv_timeline-inverted"' : '';
                ?>
>
					<div class="jv_timeline-badge <?php 
                echo $javo_badge;
                ?>
"><i class="glyphicon glyphicon-check"></i></div>
					<div class="jv_timeline-panel">
						<div class="jv_timeline-heading">
							<h4 class="jv_timeline-title"><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h4>
							<p><small class="text-muted"><i class="glyphicon glyphicon-time"></i> <?php 
                echo get_the_date();
                ?>
</small></p>
						</div>
						<div class="jv_timeline-body">
							<div class="row">
								<a href="<?php 
                the_permalink();
                ?>
">
									<div class="col-md-6">
										<?php 
                if (has_post_thumbnail()) {
                    the_post_thumbnail('medium');
                }
                ?>
									</div>
									<div class="col-md-6">
										<?php 
                echo javo_str_cut(get_the_content(), 150);
                ?>
									</div>
								</a>
							</div><!-- Close Row -->
						</div><!-- Timeline Body-->
					</div>
				</li>
			<?php 
            }
            // End While
        }
        // End If
        $javo_timeline_content = ob_get_clean();
        wp_reset_query();
        echo json_encode(array('result' => 'hi', 'content' => $javo_timeline_content));
        exit;
    }
开发者ID:redcypress,项目名称:lacecake,代码行数:87,代码来源:javo-item-time-line.php

示例14: widget

    function widget($args, $instance)
    {
        global $javo_tso;
        extract($args, EXTR_SKIP);
        $javo_query = new javo_ARRAY($instance);
        $javo_this_post_type = $javo_query->get('post_type', 'post');
        $javo_this_post_excerpt_limit = (int) $javo_query->get('excerpt_length', 20);
        $javo_this_widget_title = apply_filters('widget_title', $javo_query->get('title', null));
        $javo_this_posts_args = array('post_type' => $javo_this_post_type, 'posts_per_page' => (int) $javo_query->get('post_count', 3), 'post_status' => 'publish');
        $javo_this_posts = new WP_Query($javo_this_posts_args);
        ob_start();
        echo $before_widget;
        echo $before_title . $javo_this_widget_title . $after_title;
        ?>
		<div class="widget_posts_wrap">
			<?php 
        if ($javo_this_posts->have_posts()) {
            while ($javo_this_posts->have_posts()) {
                $javo_this_posts->the_post();
                switch ($javo_this_post_type) {
                    case 'jv_events':
                        $javo_this_permalink = javo_url(get_post_meta(get_the_ID(), 'parent_post_id', true)) . '#item-events';
                        break;
                    case 'review':
                        $javo_this_permalink = javo_url(get_post_meta(get_the_ID(), 'parent_post_id', true)) . '#item-reviews';
                        break;
                    default:
                        $javo_this_permalink = get_permalink();
                }
                ?>
					<div class="latest-posts posts row">
						<div class="col-md-12">
							<span class='thumb'>
								<a href="<?php 
                echo $javo_this_permalink;
                ?>
">
									<?php 
                if (has_post_thumbnail()) {
                    the_post_thumbnail('javo-tiny');
                } else {
                    printf('<img src="%s" class="wp-post-image" style="width:50px; height:50px;">', $javo_tso->get('no_image', JAVO_IMG_DIR . '/no-image.png'));
                }
                ?>
								</a>
							</span>
							<?php 
                printf('<h3><a href="%s">%s</a></h3><a href="%s"><span>%s</span></a>', $javo_this_permalink, javo_str_cut(get_the_title(), 20), $javo_this_permalink, javo_str_cut(strip_tags(get_the_excerpt()), $javo_this_post_excerpt_limit));
                ?>
						</div><!-- /.col-md-12 -->
					</div><!-- /.row -->
					<?php 
            }
        } else {
            _e('Not Found Posts.', 'javo_fr');
        }
        ?>
		</div><!-- /.widget_posts_wrap -->
		<?php 
        wp_reset_query();
        echo $after_widget;
        ob_end_flush();
    }
开发者ID:redcypress,项目名称:lacecake,代码行数:63,代码来源:wg-javo-recent-post.php

示例15: the_permalink



							</div><!-- /.col-md-4 -->
						</div><!-- /.row -->


						<div class="row">
							<div class="col-md-12 javo-archive-list-excerpt">
								<a href="<?php 
the_permalink();
?>
">
									<div class="javo-archive-list-inner-excerpt">
										<?php 
$javo_this_excerpt = get_the_excerpt() != "" ? get_the_excerpt() : __('No Content', 'javo_fr');
echo javo_str_cut($javo_this_excerpt, 550);
?>
									</div>
								</a>

							</div><!-- /.col-md-12 -->

						</div><!-- /.row -->

					</div><!-- /.media-body -->
				</div><!-- /.media	 -->
			</div><!-- /.col-md-12 -->
		</div><!-- /.row -->
		<div class="javo-archive-list-content-bottom">
			<div class="row">
				<div class="col-md-9 col-sm-10">
开发者ID:ksingh812,项目名称:epb,代码行数:29,代码来源:content-archive.php


注:本文中的javo_str_cut函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。