本文整理汇总了PHP中gdlr_get_item_title函数的典型用法代码示例。如果您正苦于以下问题:PHP gdlr_get_item_title函数的具体用法?PHP gdlr_get_item_title怎么用?PHP gdlr_get_item_title使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了gdlr_get_item_title函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gdlr_print_hotel_availability_item
function gdlr_print_hotel_availability_item($settings = array())
{
$item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
global $gdlr_spaces, $hotel_option;
$margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-blog-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
$margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
$current_date = current_time('Y-m-d');
$next_date = date('Y-m-d', strtotime($current_date . "+1 days"));
$value = array('gdlr-check-in' => $current_date, 'gdlr-night' => 1, 'gdlr-check-out' => $next_date, 'gdlr-room-number' => 1, 'gdlr-adult-number' => 1, 'gdlr-children-number' => 0);
$ret = gdlr_get_item_title($settings);
$ret .= '<div class="gdlr-hotel-availability-wrapper';
if (!empty($hotel_option['enable-hotel-branch']) && $hotel_option['enable-hotel-branch'] == 'enable') {
$ret .= ' gdlr-hotel-branches-enable';
}
$ret .= '" ' . $margin_style . $item_id . ' >';
$ret .= '<form class="gdlr-hotel-availability gdlr-item" id="gdlr-hotel-availability" method="post" action="' . esc_url(add_query_arg(array($hotel_option['booking-slug'] => ''), home_url('/'))) . '" >';
if (!empty($hotel_option['enable-hotel-branch']) && $hotel_option['enable-hotel-branch'] == 'enable') {
$ret .= gdlr_get_reservation_branch_combobox(array('title' => __('Hotel Branches', 'gdlr-hotel'), 'slug' => 'gdlr-hotel-branches', 'id' => 'gdlr-hotel-branches', 'value' => ''));
}
$ret .= gdlr_get_reservation_datepicker(array('title' => __('Check In', 'gdlr-hotel'), 'slug' => 'gdlr-check-in', 'id' => 'gdlr-check-in', 'value' => $value['gdlr-check-in']));
$ret .= gdlr_get_reservation_combobox(array('title' => __('Night', 'gdlr-hotel'), 'slug' => 'gdlr-night', 'id' => 'gdlr-night', 'value' => $value['gdlr-night']));
$ret .= gdlr_get_reservation_datepicker(array('title' => __('Check Out', 'gdlr-hotel'), 'slug' => 'gdlr-check-out', 'id' => 'gdlr-check-out', 'value' => $value['gdlr-check-out']));
$ret .= gdlr_get_reservation_combobox(array('title' => __('Adults', 'gdlr-hotel'), 'slug' => 'gdlr-adult-number', 'id' => '', 'value' => $value['gdlr-adult-number'], 'multiple' => true));
$ret .= gdlr_get_reservation_combobox(array('title' => __('Children', 'gdlr-hotel'), 'slug' => 'gdlr-children-number', 'id' => '', 'value' => $value['gdlr-children-number'], 'multiple' => true));
$ret .= '<div class="gdlr-hotel-availability-submit" >';
$ret .= '<input type="hidden" name="hotel_data" value="1" >';
$ret .= '<input type="hidden" name="gdlr-room-number" value="1" />';
$ret .= '<input type="submit" class="gdlr-reservation-bar-button gdlr-button with-border" value="' . __('Check Availability', 'gdlr-hotel') . '" >';
$ret .= '</div>';
$ret .= '<div class="clear"></div>';
$ret .= '</form>';
$ret .= '</div>';
return $ret;
}
示例2: gdlr_print_league_table_item
function gdlr_print_league_table_item($settings)
{
$item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
global $gdlr_spaces;
$margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
$margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
// query league table
$args = array('post_type' => 'league_table', 'suppress_filters' => false);
$args['posts_per_page'] = 999;
$args['paged'] = 1;
$args['orderby'] = 'title';
$args['order'] = 'asc';
if (!empty($settings['category'])) {
$args['tax_query'] = array();
if (!empty($settings['category'])) {
array_push($args['tax_query'], array('terms' => explode(',', $settings['category']), 'taxonomy' => 'league_category', 'field' => 'slug'));
}
}
$query = new WP_Query($args);
// getting table array
$league_table = array();
while ($query->have_posts()) {
$query->the_post();
$league_val = gdlr_lms_decode_preventslashes(get_post_meta(get_the_ID(), 'gdlr-soccer-league-table-settings', true));
$league_options = empty($league_val) ? array() : json_decode($league_val, true);
$lists = array('win', 'draw', 'lose');
$league_table[get_the_title()] = $league_options;
foreach ($lists as $list) {
$league_table[get_the_title()]['overall-' . $list] = $league_table[get_the_title()]['home-' . $list] + $league_table[get_the_title()]['away-' . $list];
}
$league_table[get_the_title()]['p'] = $league_table[get_the_title()]['overall-win'] + $league_table[get_the_title()]['overall-draw'] + $league_table[get_the_title()]['overall-lose'];
$league_table[get_the_title()]['gd'] = $league_table[get_the_title()]['home-goal-score'] + $league_table[get_the_title()]['away-goal-score'] - ($league_table[get_the_title()]['home-goal-concede'] + $league_table[get_the_title()]['away-goal-concede']);
$league_table[get_the_title()]['pts'] = $league_table[get_the_title()]['overall-win'] * 3 + $league_table[get_the_title()]['overall-draw'];
}
$league_table = gdlr_sort_league_table($league_table);
echo gdlr_get_item_title($settings);
echo '<div class="gdlr-item gdlr-league-table-item" ' . $item_id . $margin_style . ' >';
if (empty($settings['style']) || $settings['style'] == 'full') {
gdlr_print_league_table_table($league_table);
} else {
gdlr_print_league_small_table($league_table, $settings['num-display']);
if (!empty($settings['button-link'])) {
echo '<a class="gdlr-full-table-link gdlr-button with-border" href="' . $settings['button-link'] . '">' . $settings['button-text'] . '</a>';
}
}
echo '</div>';
}
示例3: gdlr_lms_print_instructor_item
function gdlr_lms_print_instructor_item($settings, $page_builder = false)
{
if ($page_builder) {
$item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
global $gdlr_spaces;
$margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-blog-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
$margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
echo gdlr_get_item_title($settings);
} else {
$item_id = '';
$margin_style = "";
}
// query instructor
if (!empty($settings['instructor-type']) && $settings['instructor-type'] == 'single') {
$query = array($settings['user']);
$settings['instructor-size'] = 1;
} else {
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$args = array();
$args['role'] = empty($settings['role']) || $settings['role'] == 'all' ? '' : $settings['role'];
$args['orderby'] = empty($settings['orderby']) ? 'display_name' : $settings['orderby'];
$args['order'] = empty($settings['order']) ? 'asc' : $settings['order'];
$args['number'] = empty($settings['num-fetch']) ? '6' : $settings['num-fetch'];
$args['offset'] = (intval($paged) - 1) * intval($args['number']);
$query = get_users($args);
$settings['instructor-size'] = empty($settings['instructor-size']) ? 3 : $settings['instructor-size'];
}
echo '<div class="instructor-item-wrapper" ' . $item_id . $margin_style . ' >';
if ($settings['instructor-style'] == 'grid') {
gdlr_lms_print_instructor_grid($query, $settings['thumbnail-size'], $settings['instructor-size'], $settings['num-excerpt']);
} else {
if ($settings['instructor-style'] == 'grid-2') {
gdlr_lms_print_instructor_grid2($query, $settings['thumbnail-size'], $settings['instructor-size'], $settings['num-excerpt']);
}
}
if (!empty($settings['instructor-type']) && $settings['instructor-type'] == 'multiple' && !empty($settings['pagination']) && $settings['pagination'] == 'enable') {
echo gdlr_lms_get_pagination($query->max_num_pages, $paged);
}
echo '</div>';
// instructor-item-wrapper
}
示例4: gdlr_print_room_item
function gdlr_print_room_item($settings = array())
{
$item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
global $gdlr_spaces;
$margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-blog-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
$margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
// query posts section
$args = array('post_type' => 'room', 'suppress_filters' => false);
$args['posts_per_page'] = empty($settings['num-fetch']) ? '5' : $settings['num-fetch'];
$args['orderby'] = empty($settings['orderby']) ? 'post_date' : $settings['orderby'];
$args['order'] = empty($settings['order']) ? 'desc' : $settings['order'];
$args['paged'] = get_query_var('paged') ? get_query_var('paged') : 1;
if (!empty($settings['category']) || !empty($settings['tag'])) {
$args['tax_query'] = array('relation' => 'OR');
if (!empty($settings['category'])) {
array_push($args['tax_query'], array('terms' => explode(',', $settings['category']), 'taxonomy' => 'room_category', 'field' => 'slug'));
}
if (!empty($settings['tag'])) {
array_push($args['tax_query'], array('terms' => explode(',', $settings['tag']), 'taxonomy' => 'room_tag', 'field' => 'slug'));
}
}
$query = new WP_Query($args);
$no_space = strpos($settings['room-style'], 'no-space') > 0 ? 'gdlr-item-no-space' : '';
$settings['room-style'] = str_replace('-no-space', '', $settings['room-style']);
if (($settings['room-style'] == 'classic' || $settings['room-style'] == 'modern') && !empty($settings['enable-carousel']) && $settings['enable-carousel'] == 'enable') {
$settings['carousel'] = true;
}
$ret = gdlr_get_item_title($settings);
$ret .= '<div class="room-item-wrapper type-' . $settings['room-style'] . '" ' . $item_id . $margin_style . '>';
$ret .= '<div class="room-item-holder ' . $no_space . '">';
if ($settings['room-style'] == 'medium') {
global $gdlr_excerpt_length, $gdlr_excerpt_read_more, $gdlr_excerpt_word;
$gdlr_excerpt_read_more = false;
$gdlr_excerpt_length = $settings['num-excerpt'];
add_filter('excerpt_length', 'gdlr_set_excerpt_length');
$ret .= gdlr_get_medium_room($query, $settings['thumbnail-size']);
$gdlr_excerpt_word = '';
$gdlr_excerpt_read_more = true;
remove_filter('excerpt_length', 'gdlr_set_excerpt_length');
} else {
if ($settings['room-style'] == 'classic') {
if (!empty($settings['enable-carousel']) && $settings['enable-carousel'] == 'enable') {
$ret .= gdlr_get_classic_room_carousel($query, $settings['room-size'], $settings['thumbnail-size']);
} else {
$ret .= gdlr_get_classic_room($query, $settings['room-size'], $settings['thumbnail-size']);
}
} else {
if ($settings['room-style'] == 'modern') {
if (!empty($settings['enable-carousel']) && $settings['enable-carousel'] == 'enable') {
$ret .= gdlr_get_modern_room_carousel($query, $settings['room-size'], $settings['thumbnail-size']);
} else {
$ret .= gdlr_get_modern_room($query, $settings['room-size'], $settings['thumbnail-size']);
}
}
}
}
$ret .= '<div class="clear"></div>';
$ret .= '</div>';
if ($settings['pagination'] == 'enable') {
$ret .= gdlr_get_pagination($query->max_num_pages, $args['paged']);
}
$ret .= '</div>';
// room-item-wrapper
return $ret;
}
示例5: gdlr_get_page_list_item
function gdlr_get_page_list_item($settings)
{
if (function_exists('gdlr_include_portfolio_scirpt')) {
gdlr_include_portfolio_scirpt();
}
$item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
global $gdlr_spaces;
$margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-blog-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
$margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
$settings['title-type'] = empty($settings['title-type']) ? 'none' : $settings['title-type'];
$settings['title'] = empty($settings['title']) ? '' : $settings['title'];
$settings['caption'] = empty($settings['caption']) ? '' : $settings['caption'];
$settings['icon'] = empty($settings['icon']) ? '' : $settings['icon'];
$ret .= gdlr_get_item_title(array('title' => $settings['title'], 'caption' => $settings['caption'], 'icon' => $settings['icon'], 'type' => $settings['title-type']));
$ret .= '<div class="portfolio-item-wrapper type-' . $settings['page-style'] . '" ' . $item_id . $margin_style . '>';
// query section
$args = array('post_type' => 'page', 'suppress_filters' => false);
$args['posts_per_page'] = empty($settings['num-fetch']) ? '5' : $settings['num-fetch'];
$args['orderby'] = 'menu_order';
$args['order'] = 'asc';
$args['paged'] = get_query_var('paged') ? get_query_var('paged') : 1;
if (!empty($settings['category'])) {
$args['tax_query'] = array(array('terms' => explode(',', $settings['category']), 'taxonomy' => 'page_category', 'field' => 'slug'));
}
$query = new WP_Query($args);
// print item section
$settings['item-size'] = str_replace('1/', '', $settings['item-size']);
$ret .= '<div class="portfolio-item-holder">';
if ($settings['page-style'] == 'classic') {
$ret .= gdlr_get_classic_page_list($query, $settings['item-size'], $settings['thumbnail-size'], $settings['page-layout']);
} else {
if ($settings['page-style'] == 'modern') {
$ret .= gdlr_get_modern_page_list($query, $settings['item-size'], $settings['thumbnail-size'], $settings['page-layout']);
}
}
$ret .= '<div class="clear"></div>';
$ret .= '</div>';
if ($settings['pagination'] == 'enable') {
$ret .= gdlr_get_pagination($query->max_num_pages, $args['paged']);
}
$ret .= '</div>';
// portfolio-item-wrapper
return $ret;
}
示例6: gdlr_get_twitter_item
function gdlr_get_twitter_item($settings)
{
$item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
global $gdlr_spaces;
$margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
$margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
$ret = gdlr_get_item_title($settings);
$ret .= '<div class="gdlr-item gdlr-twitter-item" ' . $item_id . $margin_style . '>';
$gdlr_twitter = get_option('gdlr_twitter', array());
if (!is_array($gdlr_twitter) && !empty($gdlr_twitter)) {
$gdlr_twitter = unserialize($gdlr_twitter);
}
if (!is_array($gdlr_twitter)) {
$gdlr_twitter = array();
}
$show_num = $settings['show-num'];
$twitter_username = $settings['twitter-name'];
if (empty($gdlr_twitter[$twitter_username][$show_num]['data']) || empty($gdlr_twitter[$twitter_username][$show_num]['cache_time']) || time() - intval($gdlr_twitter[$twitter_username][$show_num]['cache_time']) >= $settings['cache-time'] * 3600) {
$tweets_data = gdlr_get_tweets($settings['consumer-key'], $settings['consumer-secret'], $settings['access-token'], $settings['access-token-secret'], $settings['twitter-name'], $settings['show-num']);
if (!empty($tweets_data)) {
$gdlr_twitter[$twitter_username][$show_num]['data'] = $tweets_data;
$gdlr_twitter[$twitter_username][$show_num]['cache_time'] = time();
update_option('gdlr_twitter', $gdlr_twitter);
}
} else {
$tweets_data = $gdlr_twitter[$twitter_username][$show_num]['data'];
}
$ret .= '<ul class="gdlr-twitter-widget">';
foreach ($tweets_data as $tweet_data) {
$ret .= '<li>' . $tweet_data . '</li>';
}
$ret .= '</ul>';
$ret .= '</div>';
return $ret;
}
示例7: gdlr_title_shortcode
function gdlr_title_shortcode($atts, $content = null)
{
extract(shortcode_atts(array('title' => '', 'align' => 'left', 'style' => 'divider'), $atts));
$align .= $style == 'divider' ? '-divider' : '';
$settings = array('title-type' => $align, 'title' => $title, 'caption' => $content);
return '<div class="gdlr-shortcode-wrapper">' . gdlr_get_item_title($settings) . '</div>';
}
示例8: gdlr_get_blog_item
function gdlr_get_blog_item($settings = array())
{
$item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
global $gdlr_spaces;
$margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-blog-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
$margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
$settings['title-type'] = empty($settings['title-type']) ? 'none' : $settings['title-type'];
$settings['title'] = empty($settings['title']) ? '' : $settings['title'];
$settings['caption'] = empty($settings['caption']) ? '' : $settings['caption'];
$settings['icon'] = empty($settings['icon']) ? '' : $settings['icon'];
$right_text = '';
$right_text_class = '';
$settings['right-text'] = empty($settings['right-text']) ? '' : $settings['right-text'];
$settings['right-text-link'] = empty($settings['right-text-link']) ? '' : $settings['right-text-link'];
if (!empty($settings['right-text-link'])) {
$right_text_class = 'gdlr-right-text ';
$right_text = '<a class="gdlr-right-text-link" href="' . $settings['right-text-link'] . '" >' . $settings['right-text'] . '</a>';
}
if ($settings['blog-layout'] == 'carousel') {
$carousel = true;
$right_text_class .= 'gdlr-nav-container ';
}
$ret = gdlr_get_item_title(array('title' => $settings['title'], 'caption' => $settings['caption'], 'icon' => $settings['icon'], 'type' => $settings['title-type'], 'carousel' => $carousel, 'additional_class' => $right_text_class, 'additional_html' => $right_text));
$ret .= '<div class="blog-item-wrapper" ' . $item_id . $margin_style . '>';
// query post and sticky post
$args = array('post_type' => 'post', 'suppress_filters' => false);
if (!empty($settings['category']) || !empty($settings['tag'])) {
$args['tax_query'] = array('relation' => 'OR');
if (!empty($settings['category'])) {
array_push($args['tax_query'], array('terms' => explode(',', $settings['category']), 'taxonomy' => 'category', 'field' => 'slug'));
}
if (!empty($settings['tag'])) {
array_push($args['tax_query'], array('terms' => explode(',', $settings['tag']), 'taxonomy' => 'post_tag', 'field' => 'slug'));
}
}
if ($settings['enable-sticky'] == 'enable') {
if (get_query_var('paged') <= 1) {
$sticky_args = $args;
$sticky_args['post__in'] = get_option('sticky_posts');
if (!empty($sticky_args['post__in'])) {
$sticky_query = new WP_Query($sticky_args);
}
}
$args['post__not_in'] = get_option('sticky_posts', '');
} else {
$args['ignore_sticky_posts'] = 1;
}
$args['posts_per_page'] = empty($settings['num-fetch']) ? '5' : $settings['num-fetch'];
$args['orderby'] = empty($settings['orderby']) ? 'post_date' : $settings['orderby'];
$args['order'] = empty($settings['order']) ? 'desc' : $settings['order'];
$args['paged'] = get_query_var('paged') ? get_query_var('paged') : get_query_var('page');
$args['paged'] = empty($args['paged']) ? 1 : $args['paged'];
$args['offset'] = empty($settings['offset']) ? 0 : $settings['offset'];
$query = new WP_Query($args);
// merge query
if (!empty($sticky_query)) {
$query->posts = array_merge($sticky_query->posts, $query->posts);
$query->post_count = $sticky_query->post_count + $query->post_count;
}
// set the excerpt length
if (!empty($settings['num-excerpt'])) {
global $gdlr_excerpt_length;
$gdlr_excerpt_length = $settings['num-excerpt'];
add_filter('excerpt_length', 'gdlr_set_excerpt_length');
}
// get blog by the blog style
global $gdlr_post_settings, $gdlr_lightbox_id;
$gdlr_lightbox_id++;
$gdlr_post_settings['excerpt'] = intval($settings['num-excerpt']);
$gdlr_post_settings['thumbnail-size'] = $settings['thumbnail-size'];
$gdlr_post_settings['blog-style'] = $settings['blog-style'];
$ret .= '<div class="blog-item-holder">';
if ($settings['blog-style'] == 'blog-full') {
$gdlr_post_settings['blog-info'] = array('date', 'author', 'comment', 'category');
$ret .= gdlr_get_blog_full($query);
} else {
if ($settings['blog-style'] == 'blog-medium') {
$gdlr_post_settings['blog-info'] = array('date', 'author', 'comment', 'category');
$ret .= gdlr_get_blog_medium($query);
} else {
if ($settings['blog-style'] == 'blog-grid-list') {
$gdlr_post_settings['blog-info'] = array('date', 'author');
$ret .= gdlr_get_blog_grid_list($query, $blog_size, $settings['blog-layout']);
} else {
$gdlr_post_settings['blog-info'] = array('date', 'author');
$blog_size = str_replace('blog-1-', '', $settings['blog-style']);
$ret .= gdlr_get_blog_grid($query, $blog_size, $settings['blog-layout']);
}
}
}
$ret .= '</div>';
if ($settings['pagination'] == 'enable') {
$ret .= gdlr_get_pagination($query->max_num_pages, $args['paged']);
}
$ret .= '</div>';
// blog-item-wrapper
remove_filter('excerpt_length', 'gdlr_set_excerpt_length');
return $ret;
}
示例9: gdlr_get_gallery_item
function gdlr_get_gallery_item($settings)
{
// title section
$settings['title-type'] = empty($settings['title-type']) ? 'none' : $settings['title-type'];
$settings['title'] = empty($settings['title']) ? '' : $settings['title'];
$settings['caption'] = empty($settings['caption']) ? '' : $settings['caption'];
$settings['icon'] = empty($settings['icon']) ? '' : $settings['icon'];
$ret .= gdlr_get_item_title(array('title' => $settings['title'], 'caption' => $settings['caption'], 'icon' => $settings['icon'], 'type' => $settings['title-type']));
$slider_option = json_decode($settings['slider'], true);
$slide_order = $slider_option[0];
$slide_data = $slider_option[1];
$slides = array();
foreach ($slide_order as $slide_id) {
$slides[$slide_id] = $slide_data[$slide_id];
}
$settings['slider'] = $slides;
if ($settings['gallery-style'] == 'thumbnail') {
return gdlr_get_gallery_thumbnail($settings);
}
return $ret . gdlr_get_gallery($settings);
}
示例10: gdlr_print_ticket_item
function gdlr_print_ticket_item($settings)
{
$item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
global $gdlr_spaces;
$margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
$margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
// query posts section
$args = array('post_type' => 'ticket', 'suppress_filters' => false);
$args['posts_per_page'] = empty($settings['num-fetch']) ? '999' : $settings['num-fetch'];
$args['orderby'] = empty($settings['orderby']) ? 'post_date' : $settings['orderby'];
$args['order'] = empty($settings['order']) ? 'desc' : $settings['order'];
$args['paged'] = 1;
if (!empty($settings['category'])) {
$args['tax_query'] = array(array('terms' => explode(',', $settings['category']), 'taxonomy' => 'ticket_category', 'field' => 'slug'));
}
$query = new WP_Query($args);
echo gdlr_get_item_title($settings);
echo '<div class="ticket-item-wrapper" ' . $item_id . $margin_style . ' >';
echo '<div class="ticket-item-holder">';
$current_size = 0;
while ($query->have_posts()) {
$query->the_post();
$post_val = gdlr_decode_preventslashes(get_post_meta(get_the_ID(), 'post-option', true));
$post_options = empty($post_val) ? array() : json_decode($post_val, true);
if ($current_size % $settings['ticket-size'] == 0) {
echo '<div class="clear"></div>';
}
echo '<div class="' . gdlr_get_column_class('1/' . $settings['ticket-size']) . '">';
echo '<div class="gdlr-item gdlr-ticket-item">';
echo '<div class="gdlr-ticket-head">';
echo '<div class="gdlr-ticket-head-title">' . get_the_title() . '</div>';
echo '<div class="gdlr-ticket-head-price">' . (empty($post_options['price']) ? __('Free', 'gdlr-conference') : gdlr_ticket_money_format($post_options['price'])) . '</div>';
if (!empty($post_options['featured-ticket']) && $post_options['featured-ticket'] == 'yes') {
echo '<div class="gdlr-ticket-head-featured gdlr-info-font">' . __('Featured!', 'gdlr-conference') . '</div>';
}
echo '</div>';
// gdlr-ticket-head
echo '<div class="gdlr-ticket-content gdlr-info-font">';
the_content();
echo '</div>';
// gdlr-ticket-content
if (!empty($post_options['button-link'])) {
echo '<a class="gdlr-ticket-button" href="' . esc_attr($post_options['button-link']) . '">' . __('Book Now', 'gdlr-conference') . '</a>';
} else {
if (empty($post_options['price']) && $post_options['price'] == '-1') {
echo '<a class="gdlr-ticket-button gdlr-sold-out" href="#">' . __('Sold Out', 'gdlr-conference') . '</a>';
} else {
global $ticket_id;
$ticket_id = empty($ticket_id) ? 1 : $ticket_id + 1;
echo '<div class="gdlr-lightbox-form" id="gdlr-form-' . $ticket_id . '" >' . gdlr_paypal_form() . '</div>';
echo '<a class="gdlr-ticket-button" href="#gdlr-form-' . $ticket_id . '" data-rel="fancybox" data-fancybox-type="inline" >' . __('Book Now', 'gdlr-conference') . '</a>';
}
}
echo '</div>';
// gdlr-item
echo '</div>';
// gdlr-column-class
$current_size++;
}
wp_reset_postdata();
echo '<div class="clear"></div>';
echo '</div>';
echo '</div>';
// ticket item wrapper
}
示例11: gdlr_get_twitter_item
function gdlr_get_twitter_item($settings)
{
$gdlr_twitter = get_option('gdlr_twitter', array());
if (!is_array($gdlr_twitter) && !empty($gdlr_twitter)) {
$gdlr_twitter = unserialize($gdlr_twitter);
}
if (!is_array($gdlr_twitter)) {
$gdlr_twitter = array();
}
$show_num = $settings['show-num'];
$twitter_username = $settings['twitter-name'];
if (empty($gdlr_twitter[$twitter_username][$show_num]['data']) || empty($gdlr_twitter[$twitter_username][$show_num]['cache_time']) || time() - intval($gdlr_twitter[$twitter_username][$show_num]['cache_time']) >= $settings['cache-time'] * 3600) {
$tweets_data = gdlr_get_tweets($settings['consumer-key'], $settings['consumer-secret'], $settings['access-token'], $settings['access-token-secret'], $settings['twitter-name'], $settings['show-num']);
if (!empty($tweets_data)) {
$gdlr_twitter[$twitter_username][$show_num]['data'] = $tweets_data;
$gdlr_twitter[$twitter_username][$show_num]['cache_time'] = time();
update_option('gdlr_twitter', $gdlr_twitter);
}
} else {
$tweets_data = $gdlr_twitter[$twitter_username][$show_num]['data'];
}
$settings['title'] = '<i class="fa fa-twitter icon-twitter"></i>';
$settings['title-type'] = 'center gdlr-twitter-title';
$settings['carousel'] = true;
$ret = gdlr_get_item_title($settings);
$ret .= '<div class="gdlr-item gdlr-twitter-item" >';
$ret .= '<div class="flexslider" data-type="carousel" data-columns="1" data-nav-container="gdlr-twitter-item" >';
$ret .= '<ul class="slides">';
foreach ($tweets_data as $tweet_data) {
$ret .= '<li>' . utf8_decode($tweet_data) . '</li>';
}
$ret .= '</ul>';
$ret .= '</div>';
// flexslider
$ret .= '</div>';
// gdlr-twitter-item
return $ret;
}
示例12: gdlr_print_cause_item
function gdlr_print_cause_item($settings = array())
{
$item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
global $gdlr_spaces, $gdlr_excerpt_read_more;
$margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-blog-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
$margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
$settings['title-type'] = empty($settings['title-type']) ? 'none' : $settings['title-type'];
$settings['title'] = empty($settings['title']) ? '' : $settings['title'];
$settings['caption'] = empty($settings['caption']) ? '' : $settings['caption'];
$settings['icon'] = empty($settings['icon']) ? '' : $settings['icon'];
$right_text = '';
$right_text_class = '';
$carousel = false;
$settings['right-text'] = empty($settings['right-text']) ? '' : $settings['right-text'];
$settings['right-text-link'] = empty($settings['right-text-link']) ? '' : $settings['right-text-link'];
if (!empty($settings['right-text-link']) && !empty($settings['right-text'])) {
$right_text_class = 'gdlr-right-text ';
$right_text .= '<a class="gdlr-right-text-link" href="' . $settings['right-text-link'] . '" >' . $settings['right-text'] . '</a>';
}
if ($settings['cause-style'] == 'grid' && $settings['cause-layout'] == 'carousel') {
$carousel = true;
$right_text_class .= 'gdlr-nav-container ';
}
$ret = gdlr_get_item_title(array('title' => $settings['title'], 'caption' => $settings['caption'], 'icon' => $settings['icon'], 'type' => $settings['title-type'], 'carousel' => $carousel, 'additional_class' => $right_text_class, 'additional_html' => $right_text));
$ret .= '<div class="cause-item-wrapper" ' . $item_id . $margin_style . ' >';
// query posts section
$args = array('post_type' => 'cause', 'suppress_filters' => false);
$args['posts_per_page'] = empty($settings['num-fetch']) ? '5' : $settings['num-fetch'];
if ($settings['orderby'] == 'nearly') {
$args['meta_key'] = 'gdlr-donation-percent';
$args['meta_compare'] = '>';
$args['meta_value'] = '100';
$args['orderby'] = 'meta_value_num';
$args['order'] = 'desc';
} else {
if ($settings['orderby'] == 'finish') {
$args['meta_key'] = 'gdlr-donation-percent';
$args['meta_compare'] = '=';
$args['meta_value'] = '100';
$args['orderby'] = empty($settings['orderby']) ? 'post_date' : $settings['orderby'];
$args['order'] = empty($settings['order']) ? 'desc' : $settings['order'];
} else {
$args['orderby'] = empty($settings['orderby']) ? 'post_date' : $settings['orderby'];
$args['order'] = empty($settings['order']) ? 'desc' : $settings['order'];
}
}
$args['paged'] = get_query_var('paged') ? get_query_var('paged') : 1;
if (!empty($settings['category'])) {
$args['tax_query'] = array(array('terms' => explode(',', $settings['category']), 'taxonomy' => 'cause_category', 'field' => 'slug'));
}
$query = new WP_Query($args);
// excerpt number
if (!empty($settings['num-excerpt'])) {
global $gdlr_excerpt_length;
$gdlr_excerpt_length = $settings['num-excerpt'];
add_filter('excerpt_length', 'gdlr_set_excerpt_length');
}
$ret .= '<div class="cause-item-holder">';
if ($settings['cause-style'] == 'grid') {
$gdlr_excerpt_read_more = false;
$settings['cause-size'] = str_replace('1/', '', $settings['cause-size']);
$ret .= gdlr_get_cause_grid($query, $settings['cause-size'], $settings['thumbnail-size'], $settings['cause-layout'], $settings['num-excerpt']);
$gdlr_excerpt_read_more = true;
} else {
if ($settings['cause-style'] == 'medium') {
$ret .= gdlr_get_cause_medium($query, $settings['thumbnail-size'], $settings['num-excerpt']);
} else {
if ($settings['cause-style'] == 'full') {
$ret .= gdlr_get_cause_full($query, $settings['thumbnail-size'], $settings['num-excerpt']);
}
}
}
$ret .= '<div class="clear"></div>';
$ret .= '</div>';
// create pagination
if ($settings['pagination'] == 'enable') {
$ret .= gdlr_get_pagination($query->max_num_pages, $args['paged']);
}
remove_filter('excerpt_length', 'gdlr_set_excerpt_length');
$ret .= '</div>';
// cause-item-wrapper
return $ret;
}
示例13: gdlr_print_session_item
function gdlr_print_session_item($settings)
{
$item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
global $gdlr_spaces;
$margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
$margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
// query posts section
$args = array('post_type' => 'session', 'suppress_filters' => false);
$args['posts_per_page'] = '9999';
$args['meta_key'] = 'session-date';
$args['orderby'] = 'meta_value';
$args['order'] = 'asc';
if (!empty($settings['category'])) {
$args['tax_query'] = array(array('terms' => explode(',', $settings['category']), 'taxonomy' => 'session_category', 'field' => 'slug'));
}
$query = new WP_Query($args);
// set the excerpt length
if (!empty($settings['num-excerpt'])) {
global $gdlr_excerpt_length;
$gdlr_excerpt_length = $settings['num-excerpt'];
add_filter('excerpt_length', 'gdlr_set_excerpt_length');
}
echo gdlr_get_item_title($settings);
echo '<div class="session-item-wrapper" ' . $item_id . $margin_style . ' >';
if ($settings['session-style'] == 'full') {
gdlr_print_full_session($query);
} else {
if ($settings['session-style'] == 'tab') {
gdlr_print_tab_session($query);
} else {
if ($settings['session-style'] == 'small') {
gdlr_print_small_session($query);
}
}
}
remove_filter('excerpt_length', 'gdlr_set_excerpt_length');
echo '<div class="clear"></div>';
echo '</div>';
// speaker item wrapper
}
示例14: gdlr_print_player_item
function gdlr_print_player_item($settings)
{
$item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
global $gdlr_spaces;
$margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
$margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
// query posts section
$args = array('post_type' => 'player', 'suppress_filters' => false);
$args['posts_per_page'] = empty($settings['num-fetch']) ? '5' : $settings['num-fetch'];
$args['orderby'] = empty($settings['orderby']) ? 'post_date' : $settings['orderby'];
$args['order'] = empty($settings['order']) ? 'desc' : $settings['order'];
$args['paged'] = get_query_var('paged') ? get_query_var('paged') : 1;
$selected_category = $settings['category'];
if ($settings['player-layout'] == 'carousel') {
$settings['carousel'] = true;
}
echo '<div class="player-item-wrapper" ' . $item_id . $margin_style . ' data-ajax="' . AJAX_URL . '" >';
echo gdlr_get_item_title($settings);
// create the player filter
if ($settings['player-filter'] == 'enable') {
// ajax infomation
echo '<div class="gdlr-ajax-info" data-num-fetch="' . $args['posts_per_page'] . '" ';
echo 'data-orderby="' . $args['orderby'] . '" data-order="' . $args['order'] . '" data-pagination="' . $settings['pagination'] . '" ';
echo 'data-thumbnail-size="' . $settings['thumbnail-size'] . '" data-player-style="' . $settings['player-style'] . '" ';
echo 'data-player-size="' . $settings['player-size'] . '" data-player-layout="' . $settings['player-layout'] . '" ';
echo 'data-ajax="' . admin_url('admin-ajax.php') . '" data-category="' . $settings['category'] . '" ></div>';
// category filter
if (empty($settings['category'])) {
$parent = array('gdlr-all' => __('All', 'gdlr-soccer'));
$settings['category-id'] = '';
} else {
$term = get_term_by('slug', $settings['category'], 'player_category');
$parent = array($settings['category'] => $term->name);
$settings['category-id'] = $term->term_id;
}
//$filters = $parent + gdlr_get_term_list('player_category', $settings['category-id']);
$filters = gdlr_get_term_list('player_category', $settings['category-id']);
$filter_category = empty($_GET['player-filter']) ? '' : $_GET['player-filter'];
echo '<div class="player-item-filter">';
foreach ($filters as $filter_id => $filter) {
$filter_id = $filter_id == 'gdlr-all' ? '' : $filter_id;
echo '<span class="gdlr-saperator">|</span>';
if (empty($filter_category)) {
$filter_category = 'gdlr-player-selected';
$selected_category = $filter_id;
echo '<a class="gdlr-title-font active" href="#" ';
} else {
if ($filter_category != 'gdlr-player-selected' && $filter_category == $filter_id) {
$selected_category = $filter_id;
echo '<a class="gdlr-title-font active" href="#" ';
} else {
echo '<a class="gdlr-title-font" href="#" ';
}
}
echo 'data-category="' . $filter_id . '" >' . $filter . '</a>';
}
echo '</div>';
}
if (!empty($selected_category)) {
$args['tax_query'] = array(array('terms' => explode(',', $selected_category), 'taxonomy' => 'player_category', 'field' => 'slug'));
}
$query = new WP_Query($args);
echo '<div class="player-item-holder">';
if ($settings['player-style'] == 'classic') {
gdlr_print_classic_player($query, $settings['player-size'], $settings['thumbnail-size'], $settings['player-layout']);
} else {
if ($settings['player-style'] == 'modern') {
gdlr_print_modern_player($query, $settings['player-size'], $settings['thumbnail-size'], $settings['player-layout']);
}
}
echo '<div class="clear"></div>';
echo '</div>';
// create pagination
if ($settings['player-filter'] == 'enable' && $settings['pagination'] == 'enable') {
echo gdlr_get_ajax_pagination($query->max_num_pages, $args['paged']);
} else {
if ($settings['pagination'] == 'enable') {
echo gdlr_get_pagination($query->max_num_pages, $args['paged']);
}
}
echo '</div>';
// player item wrapper
}
示例15: gdlr_print_portfolio_item
function gdlr_print_portfolio_item($settings = array())
{
gdlr_include_portfolio_scirpt();
$item_id = empty($settings['page-item-id']) ? '' : ' id="' . $settings['page-item-id'] . '" ';
global $gdlr_spaces;
$margin = !empty($settings['margin-bottom']) && $settings['margin-bottom'] != $gdlr_spaces['bottom-blog-item'] ? 'margin-bottom: ' . $settings['margin-bottom'] . ';' : '';
$margin_style = !empty($margin) ? ' style="' . $margin . '" ' : '';
$settings['title-type'] = empty($settings['title-type']) ? 'none' : $settings['title-type'];
$settings['title'] = empty($settings['title']) ? '' : $settings['title'];
$settings['caption'] = empty($settings['caption']) ? '' : $settings['caption'];
$settings['icon'] = empty($settings['icon']) ? '' : $settings['icon'];
$right_text = '';
$right_text_class = '';
$carousel = false;
$settings['right-text'] = empty($settings['right-text']) ? '' : $settings['right-text'];
$settings['right-text-link'] = empty($settings['right-text-link']) ? '' : $settings['right-text-link'];
if (!empty($settings['right-text-link']) && !empty($settings['right-text'])) {
$right_text_class = 'gdlr-right-text ';
$right_text .= '<a class="gdlr-right-text-link" href="' . $settings['right-text-link'] . '" >' . $settings['right-text'] . '</a>';
}
if ($settings['portfolio-layout'] == 'carousel') {
$carousel = true;
$right_text_class .= 'gdlr-nav-container ';
}
$ret = gdlr_get_item_title(array('title' => $settings['title'], 'caption' => $settings['caption'], 'icon' => $settings['icon'], 'type' => $settings['title-type'], 'carousel' => $carousel, 'additional_class' => $right_text_class, 'additional_html' => $right_text));
$ret .= '<div class="portfolio-item-wrapper type-' . $settings['portfolio-style'] . '" ';
$ret .= $item_id . $margin_style . ' data-ajax="' . AJAX_URL . '" >';
// query posts section
$args = array('post_type' => 'portfolio', 'suppress_filters' => false);
$args['posts_per_page'] = empty($settings['num-fetch']) ? '5' : $settings['num-fetch'];
$args['orderby'] = empty($settings['orderby']) ? 'post_date' : $settings['orderby'];
$args['order'] = empty($settings['order']) ? 'desc' : $settings['order'];
$args['paged'] = get_query_var('paged') ? get_query_var('paged') : 1;
if (!empty($settings['category']) || !empty($settings['tag']) && $settings['portfolio-filter'] == 'disable') {
$args['tax_query'] = array('relation' => 'OR');
if (!empty($settings['category'])) {
array_push($args['tax_query'], array('terms' => explode(',', $settings['category']), 'taxonomy' => 'portfolio_category', 'field' => 'slug'));
}
if (!empty($settings['tag']) && $settings['portfolio-filter'] == 'disable') {
array_push($args['tax_query'], array('terms' => explode(',', $settings['tag']), 'taxonomy' => 'portfolio_tag', 'field' => 'slug'));
}
}
$query = new WP_Query($args);
// create the portfolio filter
$settings['portfolio-size'] = str_replace('1/', '', $settings['portfolio-size']);
if ($settings['portfolio-filter'] == 'enable') {
// ajax infomation
$ret .= '<div class="gdlr-ajax-info" data-num-fetch="' . $args['posts_per_page'] . '" ';
$ret .= 'data-orderby="' . $args['orderby'] . '" data-order="' . $args['order'] . '" ';
$ret .= 'data-thumbnail-size="' . $settings['thumbnail-size'] . '" data-port-style="' . $settings['portfolio-style'] . '" ';
$ret .= 'data-port-size="' . $settings['portfolio-size'] . '" data-port-layout="' . $settings['portfolio-layout'] . '" ';
$ret .= 'data-ajax="' . admin_url('admin-ajax.php') . '" data-category="' . $settings['category'] . '" ></div>';
// category filter
if (empty($settings['category'])) {
$parent = array('gdlr-all' => __('All', 'gdlr-portfolio'));
$settigns['category-id'] = '';
} else {
$term = get_term_by('slug', $settings['category'], 'portfolio_category');
$parent = array($settings['category'] => $term->name);
$settings['category-id'] = $term->term_id;
}
$filters = $parent + gdlr_get_term_list('portfolio_category', $settings['category-id']);
$filter_active = 'active';
$ret .= '<div class="portfolio-item-filter">';
foreach ($filters as $filter_id => $filter) {
$filter_id = $filter_id == 'gdlr-all' ? '' : $filter_id;
$ret .= '<a class="' . $filter_active . '" href="#" ';
$ret .= 'data-category="' . $filter_id . '" ><span class="sep">/</span>' . $filter . '</a>';
$filter_active = '';
}
$ret .= '</div>';
}
$no_space = strpos($settings['portfolio-style'], 'no-space') > 0 ? 'gdlr-item-no-space' : '';
$no_space .= ' gdlr-portfolio-column-' . $settings['portfolio-size'];
$ret .= '<div class="portfolio-item-holder ' . $no_space . '">';
if ($settings['portfolio-style'] == 'classic-portfolio' || $settings['portfolio-style'] == 'classic-portfolio-no-space') {
$ret .= gdlr_get_classic_portfolio($query, $settings['portfolio-size'], $settings['thumbnail-size'], $settings['portfolio-layout']);
} else {
if ($settings['portfolio-style'] == 'modern-portfolio' || $settings['portfolio-style'] == 'modern-portfolio-no-space') {
$ret .= gdlr_get_modern_portfolio($query, $settings['portfolio-size'], $settings['thumbnail-size'], $settings['portfolio-layout']);
}
}
$ret .= '<div class="clear"></div>';
$ret .= '</div>';
// create pagination
if ($settings['portfolio-filter'] == 'enable' && $settings['pagination'] == 'enable') {
$ret .= gdlr_get_ajax_pagination($query->max_num_pages, $args['paged']);
} else {
if ($settings['pagination'] == 'enable') {
$ret .= gdlr_get_pagination($query->max_num_pages, $args['paged']);
}
}
$ret .= '</div>';
// portfolio-item-wrapper
return $ret;
}