本文整理汇总了PHP中tfuse_page_options函数的典型用法代码示例。如果您正苦于以下问题:PHP tfuse_page_options函数的具体用法?PHP tfuse_page_options怎么用?PHP tfuse_page_options使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tfuse_page_options函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: widget
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
$posts = isset($instance['posts']) ? $instance['posts'] : array();
if (!empty($posts)) {
echo '<div class="widget widget_text">
<h3 class="widget-title">' . $title . '</h3>
<div class="textwidget">';
foreach ($posts as $key => $post) {
$image = get_the_post_thumbnail($key, 'members-widget-thumb');
$email = tfuse_page_options('member_email', '', $key);
$job = tfuse_page_options('member_job', '', $key);
$phone = tfuse_page_options('member_phone', '', $key);
echo '<div class="contact-person">
' . $image . '
<div class="contact-person-info">
<strong>' . get_the_title($key) . '</strong>';
if (!empty($job)) {
echo '<em>' . $job . '</em>';
}
if (!empty($phone)) {
echo '<span>' . $phone . '</span>';
}
if (!empty($email)) {
echo '<a href="mailto:' . $email . '">' . $email . '</a>';
}
echo '</div>
</div>';
}
echo '</div>
</div>';
}
}
示例2: tfuse_members
function tfuse_members($atts, $content = null)
{
extract(shortcode_atts(array('post' => ''), $atts));
$output = '';
$post = explode(',', $post);
$query = new WP_Query(array('posts_per_page' => -1, 'post_type' => 'member', 'post__in' => $post));
$posts = $query->get_posts();
if (!empty($posts)) {
$output .= '<div class="our-team">';
foreach ($posts as $post) {
$job = tfuse_page_options('job', '', $post->ID);
$image = wp_get_attachment_url(get_post_thumbnail_id($post->ID, 'post-thumbnails'));
if (!empty($image)) {
$image = TF_GET_IMAGE::get_src_link($image, 270, 270);
}
$output .= '<div class="col-lg-3 col-md-3 col-sm-6 col-xs-6">
<div class="image-our-team">
<img src="' . $image . '" alt="' . $post->post_title . '">
</div>
<h3>' . $post->post_title . '</h3>
<span class="function">' . $job . '</span>
</div>';
}
$output .= '</div>';
}
return $output;
}
示例3: tfuse_faq
function tfuse_faq($atts, $content = null)
{
extract(shortcode_atts(array('post' => ''), $atts));
$output = '';
$post = explode(',', $post);
$query = new WP_Query(array('posts_per_page' => -1, 'post_type' => 'faq', 'post__in' => $post));
$posts = $query->get_posts();
if (!empty($posts)) {
foreach ($posts as $post) {
$btn_title = tfuse_page_options('btn_title', '', $post->ID);
$output .= '<div class="faq-article clearfix">
<div class="col-md-8 col-sm-7 col-xs-7 text">
<h2>Q: ' . $post->post_title . '</h2>
<p>' . $post->post_content . '</p>
</div>';
if (!empty($btn_title)) {
$output .= '<div class="col-md-3 col-md-offset-1 col-sm-5 col-xs-5 faq-button">
<a href="' . tfuse_page_options('btn_link', '', $post->ID) . '" class="btn btn-yellow btn-donate-faq"><span>' . $btn_title . '</span></a>
</div>';
}
$output .= '</div>';
}
// End IF Statement
}
return $output;
}
示例4: tfuse_latest_news
function tfuse_latest_news($atts, $content = null)
{
extract(shortcode_atts(array('posts' => '', 'title' => '', 'b_title' => '', 'b_link' => ''), $atts));
$posts = explode(',', $posts);
$return_html = $img = '';
if (!empty($posts)) {
$return_html .= '<section class="postlist postlist-cols-1 shortcode_news">
<h1>' . $title . '</h1>';
foreach ($posts as $post) {
$image = wp_get_attachment_url(get_post_thumbnail_id($post, 'post-thumbnails'));
$img_pos = tfuse_page_options('single_img_position', '', $post);
$post_date = get_the_date($post);
$time = strtotime($post_date);
$position = tfuse_page_options('img_pos', '', $post);
$current_post = get_post($post);
$user_data = get_user_by('id', $current_post->post_author);
$return_html .= '<article class="post">
<div class="inner">';
$press_source = tfuse_page_options('press_source', '', $post);
$press_author = tfuse_page_options('press_author', '', $post);
$is_outer_link = !empty($press_source) ? true : false;
$target_window = !empty($press_source) ? "_blank" : "_self";
$author_url = !empty($press_source) ? $press_source : get_author_posts_url($current_post->post_author, $user_data->data->user_nicename);
$press_source = !empty($press_source) ? $press_source : get_permalink($post);
$press_author = !empty($press_author) ? $press_author : $user_data->data->display_name;
if (!empty($image)) {
$return_html .= '<a class="post-thumbnail" href="' . $press_source . '"><img src="' . $image . '" alt="' . get_the_title($post) . '" /></a>';
}
$return_html .= '<div class="entry-aside">
<header class="entry-header">
<h2 class="entry-title"><a target="' . $target_window . '" href="' . $press_source . '">' . get_the_title($post) . '</a></h2>
<div class="entry-meta">
' . __('By ', 'tfuse') . '<span class="author"><a href="' . $author_url . '">' . $press_author . '</a></span>
' . __(' on ', 'tfuse') . '<time class="entry-date" datetime="' . date('Y-m-d', $time) . 'T' . date('g:i:s', $time) . '">' . get_the_time(get_option('date_format'), $post) . '</time>
</div>
</header>
<div class="entry-content">';
if (tfuse_options('post_content') == 'content') {
$return_html .= '<p>' . $current_post->post_content . '</p>';
} else {
$return_html .= !empty($current_post->post_excerpt) ? '<p>' . $current_post->post_excerpt . '</p>' : '<p>' . strip_tags(tfuse_shorten_string(apply_filters('the_content', $current_post->post_content), 150)) . '</p>';
}
$tmp_comments = $is_outer_link ? '' : '<span class="comments-link"><a href="' . $press_source . '#comments"><i class="tficon-comment"></i> ' . get_comments_number($post) . '</a></span>';
$return_html .= '</div>
<footer class="entry-meta">
<a target="' . $target_window . '" class="btn btn-default btn-xs" href="' . $press_source . '">' . __('Read more', 'tfuse') . '</a>
' . $tmp_comments . '
</footer>
</div>
</div>
</article>';
}
$return_html .= '<div class="load_button">
<a href="' . $b_link . '" class="btn btn-main">' . $b_title . '</a>
</div>';
$return_html .= '</section>';
}
return $return_html;
}
示例5: tfuse_shortcode_posts
/**
* Generate array with: recent/popular/most commented posts
* @param string $sort Sort type (recent/popular/most commented)
* @param integer $items Number of items to be extracted
* @param boolean $image_post Extract or no post image
* @param integer $image_width Set width of post image
* @param integer $image_height Set height of post image
* @param string $image_class Set class of post image
* @param boolean $date_post Extract or no post date
* @param string $date_format Set date format
* @param string $post_type Set post type
* @param string $category Set category from where posts would be extracted
* @since Medica 2.0
*/
function tfuse_shortcode_posts($args = null)
{
$defaults = array('sort' => 'recent', 'items' => 5, 'image_post' => true, 'image_width' => 54, 'image_height' => 54, 'image_class' => 'thumbnail', 'date_post' => true, 'date_format' => 'F jS, Y', 'post_type' => 'post', 'category' => '', 'specialites' => '');
extract(wp_parse_args($args, $defaults));
global $post;
$tf_cat_ID = !empty($category) && empty($specialites) ? get_cat_ID($category) : '';
$specialites = empty($category) && !empty($specialites) ? $specialites : '';
if ($sort == 'recent') {
$query = new WP_Query(array('post_type' => $post_type, 'orderby' => 'post_date', 'order ' => 'DESC', 'cat' => $tf_cat_ID, 'Specialites' => $specialites, 'posts_per_page' => $items));
$posts = $query->get_posts();
} elseif ($sort == 'popular') {
$query = new WP_Query(array('post_type' => $post_type, 'orderby' => 'meta_value', 'meta_key' => TF_THEME_PREFIX . '_post_viewed', 'order ' => 'DESC', 'cat' => $tf_cat_ID, 'posts_per_page' => $items));
$posts = $query->get_posts();
} elseif ($sort == 'commented') {
$query = new WP_Query(array('post_type' => $post_type, 'orderby' => 'comment_count', 'order ' => 'DESC', 'cat' => $tf_cat_ID, 'posts_per_page' => $items));
$posts = $query->get_posts();
} else {
return false;
}
$tf_post_option = array();
$count = 0;
if (!empty($posts)) {
foreach ($posts as $post_elm) {
setup_postdata($post_elm);
$img = '';
if ($image_post == true) {
$post_image_src = tfuse_page_options('thumbnail_image', tfuse_page_options('single_image', null, $post_elm->ID), $post_elm->ID);
if (!empty($post_image_src)) {
$get_image = new TF_GET_IMAGE();
$img = $get_image->properties(array('class' => $image_class, 'alt' => get_the_title($post_elm->ID)))->width($image_width)->height($image_height)->src($post_image_src)->resize(true)->get_img();
}
}
if (!empty($img)) {
$tf_post_option[$count]['post_img'] = $img;
} else {
$tf_post_option[$count]['post_img'] = '';
}
if ($date_post) {
$time_format = apply_filters('tfuse_widget_time_format', $date_format);
$tf_post_option[$count]['post_date_post'] = get_the_time($time_format, $post_elm->ID);
} else {
$tf_post_option[$count]['post_date_post'] = '';
}
$tf_post_option[$count]['post_class'] = is_singular() && $post->ID == $post_elm->ID ? 'current-menu-item post_' . $sort : 'post_' . $sort;
$tf_post_option[$count]['post_title'] = get_the_title($post_elm->ID);
$tf_post_option[$count]['post_link'] = get_permalink($post_elm->ID);
$tf_post_option[$count]['post_author_link'] = get_author_posts_url(get_the_author_meta('ID'));
$tf_post_option[$count]['post_author_name'] = get_the_author();
$tf_post_option[$count]['post_comnt_numb'] = get_comments_number($post_elm->ID);
$tf_post_option[$count]['post_comnt_numb_link'] = tfuse_get_comments(true, $post_elm->ID);
$tf_post_option[$count]['post_loveit_number'] = get_post_meta($post_elm->ID, TF_THEME_PREFIX . '_post_viewed', true);
$tf_post_option[$count]['post_excerpt'] = apply_filters('get_the_excerpt', $post_elm->post_excerpt);
$count++;
}
wp_reset_postdata();
}
return $tf_post_option;
}
示例6: from_custom_field
function from_custom_field($key = 'single_imgage')
{
$src = tfuse_page_options($key);
if ($src) {
$this->src = $src;
} else {
$this->src = null;
}
return $this;
}
示例7: select_hour_end
function select_hour_end()
{
global $post;
$html = $min = $m = "";
$saved_time = tfuse_page_options('end_hour_min', false, $post->ID);
$html .= '<select class="select_hour" id="' . TF_THEME_PREFIX . '_event_hours_end" name="' . TF_THEME_PREFIX . '_event_hour_end" >';
for ($i = 1; $i <= 12; $i++) {
if ($saved_time['hour'] == $i) {
$html .= '<option selected="selected" value="' . $i . '">' . $i . '</option>';
} else {
$html .= '<option value="' . $i . '">' . $i . '</option>';
}
}
$html .= '</select>
<select class="select_minute" id="' . TF_THEME_PREFIX . '_event_minute_end" name="' . TF_THEME_PREFIX . '_event_minute_end">';
for ($i = 0; $i < 4; $i++) {
if ($i == 0) {
$min = '00';
} elseif ($i == 1) {
$min = '15';
} elseif ($i == 2) {
$min = '30';
} else {
$min = '45';
}
if ($saved_time['minute'] == $min) {
$html .= '<option selected="selected" value="' . $min . '">' . $min . '</option>';
} else {
$html .= '<option value="' . $min . '">' . $min . '</option>';
}
}
$html .= '</select>
<select class="select_time" id="' . TF_THEME_PREFIX . '_event_time_end" name="' . TF_THEME_PREFIX . '_event_time_end">';
for ($i = 1; $i <= 2; $i++) {
if ($i == 1) {
$m = 'AM';
} else {
$m = 'PM';
}
if ($saved_time['time'] == $m) {
$html .= '<option selected="selected" value="' . $m . '">' . $m . '</option>';
} else {
$html .= '<option value="' . $m . '">' . $m . '</option>';
}
}
$html .= '</select>';
return $html;
}
示例8: source
function source($source = '', $link = '')
{
if ($source != '') {
if (empty($link)) {
$this->link = tfuse_page_options($source, $source, $this->id);
} else {
$this->link = $link;
}
if ($this->link != '') {
$this->type = '';
if (stripos($this->link, "iframe") !== false) {
$this->type = "iframe";
} else {
if (preg_match('/vimeo\\.com/i', $this->link)) {
$this->type = "vimeo";
} else {
if (stripos($this->link, ".mov") !== false) {
$this->type = "quicktime";
} else {
if (stripos($this->link, ".swf") !== false) {
$this->type = "flash";
} else {
if (preg_match('/youtube\\.com\\/watch/i', $this->link)) {
$this->type = "youtube";
} else {
if (substr($this->link, 0, 1) == "#") {
$this->type = "inline";
} else {
if (stripos($this->link, 'object') != FALSE && stripos($this->link, 'param') != FALSE) {
$this->type = "object";
}
}
}
}
}
}
}
}
}
return $this;
}
示例9: tfuse_members
function tfuse_members($atts, $content = null)
{
extract(shortcode_atts(array('item' => '', 'title' => ''), $atts));
$output = $link = $count = '';
$posts = get_posts('post_type=members&posts_per_page=-1');
if (!empty($posts)) {
$output .= '<section class="team-widget">
<header>
<h1 class="team-widget-title">' . $title . '</h1>
</header>
<div class="team-content">';
foreach ($posts as $post) {
if ($count == $item) {
break;
}
$count++;
$img = tfuse_page_options('member_photo', '', $post->ID);
$id = tfuse_page_options('member_id', '', $post->ID);
$url = tfuse_page_options('member_link', '', $post->ID);
$image_src = wp_get_attachment_url(get_post_thumbnail_id($post->ID, 'post-thumbnails'));
if (!empty($url)) {
$link = $url;
} else {
$link = '';
}
$output .= '<div class="member">
<div class="member-image"><img src="' . $image_src . '" width="193" height="217" alt=""/></div>
<div class="member-descr">
<h4 class="member-name">' . get_the_title($post->ID) . '</h4>
<p><a href="' . $link . '">' . $id . '</a></p>
</div>
</div>';
}
$output .= '</ul>
</div>';
$output .= '</section>';
}
return $output;
}
示例10: tfuse_press
function tfuse_press($atts, $content = null)
{
extract(shortcode_atts(array('post' => ''), $atts));
$output = '';
$post = explode(',', $post);
$query = new WP_Query(array('posts_per_page' => -1, 'post_type' => 'press', 'post__in' => $post));
$posts = $query->get_posts();
if (!empty($posts)) {
$output .= '<div class="wrap-press">';
foreach ($posts as $post) {
$link = tfuse_page_options('link', '', $post->ID);
$source = tfuse_page_options('source', '', $post->ID);
$image = wp_get_attachment_url(get_post_thumbnail_id($post->ID, 'post-thumbnails'));
$output .= '<a href="' . $link . '" class="press-article" style="background: url(\'' . $image . '\') no-repeat">
<h3>' . $post->post_title . '</h3>
<div class="divider"></div>
<p>' . $post->post_content . '</p>
<span>' . $source . '</span>
</a>';
}
$output .= '</div>';
}
return $output;
}
示例11: widget
function widget($args, $instance)
{
extract($args);
$uniq = rand(1, 100);
$title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
$posts = isset($instance['posts']) ? $instance['posts'] : array();
$b = $instance['b'] = empty($instance['b']) ? '' : $instance['b'];
$class = $b ? 'widget-boxed' : '';
$before_widget = '<div class="widget widget_text ' . $class . '">';
$after_widget = '</div>';
$before_title = '<h3 class="widget-title">';
$after_title = '</h3>';
$tfuse_title = !empty($title) ? $before_title . tfuse_qtranslate($title) . $after_title : '';
echo $before_widget;
// echo widgets title
echo $tfuse_title;
echo '
<div class="textwidget">
<div class="portfolio portfolio-videos">
<ul class="portfolio-list">';
foreach ($posts as $key => $post) {
$video = tfuse_page_options('video_links', '', $key);
$image = get_the_post_thumbnail($key, 'video-thumb');
if (!empty($image)) {
echo '<li>
<a data-rel="prettyPhoto" href="' . $video . '">
' . $image . '
</a>
<h4><a class="video_link" href="' . get_permalink($key) . '">' . get_the_title($key) . '</a></h4>
</li>';
}
}
echo ' </ul></div>
</div>';
echo $after_widget;
}
示例12: tfuse_get_upcoming_events
function tfuse_get_upcoming_events($items)
{
$final_events = array();
$args = array('posts_per_page' => -1, 'post_type' => 'event');
$query = new WP_Query($args);
$posts = $query->posts;
if (!empty($posts)) {
$count = 0;
$posts_with_content = array();
foreach ($posts as $post) {
$posts_with_content[$post->ID] = $post;
$date = tfuse_page_options('event_date', '', $post->ID);
if (!empty($date)) {
// repeat event
$repeat = tfuse_page_options('event_repeat', '', $post->ID);
if ($repeat != 'no') {
$repeats[$post->ID] = tfuse_page_options('event_repeat', '', $post->ID);
}
if ($repeat == 'year') {
$from = tfuse_page_options('event_date', '', $post->ID);
$date = new DateTime($from);
$year = (int) $date->format('Y');
$month = $date->format('m');
$day = $date->format('d');
for ($i = 0; $i < 10; $i++) {
$permalink = get_permalink($post->ID);
$all[$count]['event_id'] = $post->ID;
$all[$count]['event_date'] = $year + $i . '-' . $month . '-' . $day;
if (strpos($permalink, "?") === false) {
$permalink = $permalink . '?date=' . $all[$count]['event_date'];
} else {
$permalink = $permalink . '&date=' . $all[$count]['event_date'];
}
$all[$count]['event_permalink'] = $permalink;
++$count;
}
} elseif ($repeat == 'month') {
$from = tfuse_page_options('event_date', '', $post->ID);
$day = strtotime($from);
for ($i = 0; $i < 10; $i++) {
$to = strtotime(date("Y-m-d", $day) . " +" . $i . " month");
$all[$count]['event_id'] = $post->ID;
$all[$count]['event_date'] = date("Y-m-d", $to);
$permalink = get_permalink($post->ID);
if (strpos($permalink, "?") === false) {
$permalink = $permalink . '?date=' . $all[$count]['event_date'];
} else {
$permalink = $permalink . '&date=' . $all[$count]['event_date'];
}
$all[$count]['event_permalink'] = $permalink;
++$count;
}
} elseif ($repeat == 'week') {
$from = tfuse_page_options('event_date', '', $post->ID);
$day = strtotime($from);
for ($i = 0; $i < 53; $i++) {
$to = strtotime(date("Y-m-d", $day) . " +" . $i . " weeks");
$all[$count]['event_id'] = $post->ID;
$all[$count]['event_date'] = date("Y-m-d", $to);
$permalink = get_permalink($post->ID);
if (strpos($permalink, "?") === false) {
$permalink = $permalink . '?date=' . $all[$count]['event_date'];
} else {
$permalink = $permalink . '&date=' . $all[$count]['event_date'];
}
$all[$count]['event_permalink'] = $permalink;
++$count;
}
} elseif ($repeat == 'day') {
$from = tfuse_page_options('event_date', '', $post->ID);
$day = strtotime($from);
for ($i = 0; $i < 365; $i++) {
$to = strtotime(date("Y-m-d", $day) . " +" . $i . " days");
$all[$count]['event_id'] = $post->ID;
$all[$count]['event_date'] = date("Y-m-d", $to);
$permalink = get_permalink($post->ID);
if (strpos($permalink, "?") === false) {
$permalink = $permalink . '?date=' . $all[$count]['event_date'];
} else {
$permalink = $permalink . '&date=' . $all[$count]['event_date'];
}
$all[$count]['event_permalink'] = $permalink;
++$count;
}
} else {
$all[$count]['event_id'] = $post->ID;
$all[$count]['event_date'] = tfuse_page_options('event_date', '', $post->ID);
$permalink = get_permalink($post->ID);
if (strpos($permalink, "?") === false) {
$permalink = $permalink . '?date=' . $all[$count]['event_date'];
} else {
$permalink = $permalink . '&date=' . $all[$count]['event_date'];
}
$all[$count]['event_permalink'] = $permalink;
++$count;
}
}
}
}
if (!empty($all)) {
//.........这里部分代码省略.........
示例13: apply_filters
<?php
/**
* The template for displaying posts on archive pages.
* To override this template in a child theme, copy this file
* to your child theme's folder.
*
* @since Philanthropy 1.0
*/
global $more, $post;
$more = apply_filters('tfuse_more_tag', 0);
$image = wp_get_attachment_url(get_post_thumbnail_id($post->ID, 'post-thumbnails'));
$gallery = tfuse_page_options('gallery');
?>
<li class="gallery-item">
<?php
if (!empty($image)) {
?>
<div class="gallery-img">
<a href="<?php
echo $image;
?>
" class="see-more-gallery" data-rel="prettyPhoto[<?php
echo $post->ID;
?>
]" title="<?php
echo get_the_title();
?>
">
<span><?php
_e('More', 'tfuse');
示例14: tfuse_add_meta_query_ratings
function tfuse_add_meta_query_ratings()
{
$ratings_exists = get_option('tfuse_ratings');
if ($ratings_exists == true) {
return;
}
$args = array('posts_per_page' => -1, 'post_type' => 'review');
$all_posts = new WP_Query($args);
$posts = $all_posts->get_posts();
if (empty($posts)) {
return;
}
foreach ($posts as $post) {
$rating = tfuse_page_options('rating', '', $post->ID);
update_post_meta($post->ID, 'tfuse_rating', $rating);
}
update_option('tfuse_ratings', true);
}
示例15: wp_get_attachment_url
* To override this template in a child theme, copy this file
* to your child theme's folder.
*
* @since Philanthropy 1.0
*/
$image = wp_get_attachment_url(get_post_thumbnail_id($post->ID, 'post-thumbnails'));
$gallery = tfuse_page_options('gallery');
$date_post = tfuse_page_options('event_date');
if (isset($_GET['date']) && $_GET['date'] != '') {
$date_post = $_GET['date'];
}
$date = new DateTime($date_post);
$year = $date->format('Y');
$month = $date->format('F jS');
$get_start_hour = tfuse_page_options('event_hour_min');
$get_end_hour = tfuse_page_options('end_hour_min');
?>
<header class="entry-header">
<h1 class="entry-title">
<?php
echo get_the_title();
?>
<span class="entry-title-min-description">
<p>
<?php
_e('Event on', 'tfuse');
?>
: <?php
echo $year . '-' . $month;
echo ' ' . $get_start_hour['hour'], ':', $get_start_hour['minute'], ' ', $get_start_hour['time'], ' - ';
echo ' ' . $get_end_hour['hour'], ':', $get_end_hour['minute'], ' ', $get_end_hour['time'];