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>';
     }
 }
Example #2
0
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;
}
Example #3
0
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;
}
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;
}
Example #5
0
 /**
  *  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;
 }
 function from_custom_field($key = 'single_imgage')
 {
     $src = tfuse_page_options($key);
     if ($src) {
         $this->src = $src;
     } else {
         $this->src = null;
     }
     return $this;
 }
 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;
 }
 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;
 }
Example #9
0
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;
}
Example #10
0
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;
}
 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;
 }
 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)) {
         $current_date = date("Y-m-d");
         $upcoming_events = array();
         $count = 0;
         $sorted = tfuse_aasort($all, 'event_date');
         foreach ($sorted as $event) {
             if ($event['event_date'] > $current_date) {
                 $upcoming_events[$count]['event_id'] = $event['event_id'];
                 $upcoming_events[$count]['event_date'] = $event['event_date'];
                 $upcoming_events[$count]['event_permalink'] = $event['event_permalink'];
                 ++$count;
             }
         }
         $items = (int) $items;
         $k = 0;
         for ($i = 0; $i < $items; $i++) {
             if ($upcoming_events[$i]['event_id'] == null) {
                 continue;
             }
             $final_events[$k]['event_id'] = $upcoming_events[$i]['event_id'];
             $final_events[$k]['event_date'] = $upcoming_events[$i]['event_date'];
             $final_events[$k]['event_permalink'] = $upcoming_events[$i]['event_permalink'];
             $final_events[$k]['event_title'] = @$posts_with_content[$upcoming_events[$i]['event_id']]->post_title;
             // get event excerpt
             if ($posts_with_content[$upcoming_events[$i]['event_id']]->post_excerpt != '') {
                 $final_events[$k]['event_excerpt'] = @$posts_with_content[$upcoming_events[$i]['event_id']]->post_excerpt;
             } else {
                 $final_events[$k]['event_excerpt'] = @$posts_with_content[$upcoming_events[$i]['event_id']]->post_content;
             }
             $k++;
         }
     }
     return $final_events;
 }
<?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');
 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);
 }
 * 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'];
    function widget($args, $instance)
    {
        extract($args);
        global $post;
        $id = '';
        ?>
            <?php 
        if ($post->post_type == 'game' || $post->post_type == 'review') {
            ?>
                <?php 
            if ($post->post_type == 'review') {
                $game_id = tfuse_page_options('game_select');
                $game_id = explode(',', $game_id);
                if (!empty($game_id)) {
                    $id = $game_id[0];
                    $title = get_the_title($id);
                }
            } else {
                $id = $post->ID;
            }
            if (!empty($id)) {
                $image = wp_get_attachment_url(get_post_thumbnail_id($id, 'post-thumbnails'));
                $published = tfuse_page_options('published', '', $id);
                $published_link = tfuse_page_options('published_link', '', $id);
                $developed = tfuse_page_options('developed', '', $id);
                $developed_link = tfuse_page_options('developed_link', '', $id);
                $description = tfuse_page_options('description', '', $id);
                $press_contact = tfuse_page_options('press_email', '', $id);
                $facebook_social = tfuse_page_options('facebook_social', '', $id);
                $twitter_social = tfuse_page_options('twitter_social', '', $id);
                $g_rating = tfuse_page_options('rating_type', '', $id);
                $esrb = tfuse_page_options('esrb', '', $id);
                $pegi = tfuse_page_options('pegi', '', $id);
                if ($g_rating == 'pegi') {
                    switch ($pegi) {
                        case '7':
                            $img_r = get_template_directory_uri() . '/images/7.png';
                            $content = __('Considered suitable for all age groups but contains some possibly frightening scenes or sounds.', 'tfuse');
                            break;
                        case '12':
                            $img_r = get_template_directory_uri() . '/images/12.png';
                            $content = __('Videogames that show violence as well as nudity of a slightly more graphic nature.', 'tfuse');
                            break;
                        case '16':
                            $img_r = get_template_directory_uri() . '/images/16.png';
                            $content = __('A video game where the depiction of violence (or sexual activity) reaches a stage that looks the same as would be expected in real life.', 'tfuse');
                            break;
                        case '18':
                            $img_r = get_template_directory_uri() . '/images/18.png';
                            $content = __('Any game where the level of violence reaches a stage where it becomes a depiction of gross violence.', 'tfuse');
                            break;
                        default:
                            $img_r = get_template_directory_uri() . '/images/3.png';
                            $content = __('The content of games given this rating is considered suitable for all age groups.', 'tfuse');
                            break;
                    }
                } else {
                    switch ($esrb) {
                        case 'e':
                            $img_r = get_template_directory_uri() . '/images/ratingsymbol_e.png';
                            $content = __('Content is generally suitable for all ages. May contain minimal cartoon, fantasy or mild violence and/or infrequent use of mild language.', 'tfuse');
                            break;
                        case 'et':
                            $img_r = get_template_directory_uri() . '/images/ratingsymbol_e10.png';
                            $content = __('Content is generally suitable for ages 10 and up. May contain more cartoon, fantasy or mild violence, mild language and/or minimal suggestive themes.', 'tfuse');
                            break;
                        case 't':
                            $img_r = get_template_directory_uri() . '/images/ratingsymbol_t.png';
                            $content = __('Content is generally suitable for ages 13 and up. May contain violence, suggestive themes, crude humor, minimal blood, simulated gambling and/or infrequent use of strong language.', 'tfuse');
                            break;
                        case 'm':
                            $img_r = get_template_directory_uri() . '/images/ratingsymbol_m.png';
                            $content = __('Content is generally suitable for ages 17 and up. May contain intense violence, blood and gore, sexual content and/or strong language.', 'tfuse');
                            break;
                        case 'a':
                            $img_r = get_template_directory_uri() . '/images/ratingsymbol_ao.png';
                            $content = __('Content suitable only for adults ages 18 and up. May include prolonged scenes of intense violence, graphic sexual content and/or gambling with real currency.', 'tfuse');
                            break;
                        case 'rp':
                            $img_r = get_template_directory_uri() . '/images/ratingsymbol_rp.png';
                            $content = __('Not yet assigned a final ESRB rating. Appears only in advertising, marketing and promotional materials related to a game that is expected to carry an ESRB rating, and should be replaced by a game\'s rating once it has been assigned.', 'tfuse');
                            break;
                        default:
                            $img_r = get_template_directory_uri() . '/images/ratingsymbol_ec.png';
                            $content = __('Content is intended for young children.', 'tfuse');
                            break;
                    }
                }
                ?>
                        <div class="widget widget_text widget-boxed">
                            <h3 class="widget-title"><?php 
                echo !empty($title) ? $title : get_the_title();
                ?>
</h3>
                            <div class="textwidget">
                                <div class="game-infobox">
                                    <?php 
                if (!empty($image)) {
                    ?>
                                        <img src="<?php 
                    echo $image;
                    ?>
" alt="" class="game-thumb"/>
                                    <?php 
                }
                ?>

                                    <?php 
                if (!empty($published)) {
                    ?>
                                        <div class="game-creator"><?php 
                    _e('Published by', 'tfuse');
                    ?>
: <span><a href="<?php 
                    echo $published_link;
                    ?>
"><?php 
                    echo $published;
                    ?>
</a></span></div>
                                    <?php 
                }
                ?>

                                    <?php 
                if (!empty($developed)) {
                    ?>
                                        <div class="game-creator"><?php 
                    _e('Developed by', 'tfuse');
                    ?>
: <span><a href="<?php 
                    echo $developed_link;
                    ?>
"><?php 
                    echo $developed;
                    ?>
</a></span></div>
                                    <?php 
                }
                ?>

                                    <?php 
                if (!empty($description)) {
                    ?>
                                        <div class="game-descr">
                                            <p><?php 
                    echo $description;
                    ?>
</p>
                                        </div>
                                    <?php 
                }
                ?>

                                    <?php 
                $terms_platforms = wp_get_post_terms($id, 'platforms_game');
                ?>

                                    <?php 
                if (!empty($terms_platforms)) {
                    ?>
                                        <h4><?php 
                    _e('Available on', 'tfuse');
                    ?>
</h4>
                                        <div class="game-inforow">
                                            <?php 
                    $k = 0;
                    foreach ($terms_platforms as $term) {
                        $k++;
                        if ($k == count($terms_platforms)) {
                            echo '<a href="' . get_term_link($term, 'platforms_game') . '">' . $term->name . '</a>';
                        } else {
                            echo '<a href="' . get_term_link($term, 'platforms_game') . '">' . $term->name . '</a> <span class="separator">|</span> ';
                        }
                    }
                    ?>
                                        </div>
                                    <?php 
                }
                ?>

                                    <?php 
                $terms_genres = wp_get_post_terms($id, 'genres_game');
                ?>
                                    <?php 
                if (!empty($terms_genres)) {
                    ?>
                                        <h4><?php 
                    _e('Genre', 'tfuse');
                    ?>
</h4>
                                        <div class="game-inforow">
                                            <?php 
                    $k = 0;
                    foreach ($terms_genres as $term) {
                        $k++;
                        if ($k == count($terms_genres)) {
                            echo '<a href="' . get_term_link($term, 'platforms_game') . '">' . $term->name . '</a>';
                        } else {
                            echo '<a href="' . get_term_link($term, 'platforms_game') . '">' . $term->name . '</a> <span class="separator">|</span> ';
                        }
                    }
                    ?>
                                        </div>
                                    <?php 
                }
                ?>

                                    
                                    
                                    <?php 
                if (!empty($press_contact)) {
                    ?>
                                        <h4><?php 
                    echo __('Press contact', 'tfuse');
                    ?>
</h4>
                                      <?php 
                    echo '<a href="mailto:' . $press_contact . '">' . $press_contact . '</a>';
                    ?>
                                        <br>
                                    <?php 
                }
                ?>
                                    
                                    <br>
                                    <?php 
                if (!empty($facebook_social) || !empty($twitter_social)) {
                    ?>
                                        <h4><?php 
                    echo __('Social', 'tfuse');
                    ?>
</h4>
                                         <div style="text-align:left" class="footer-socials">
                                         	<span class="social-icons social-icons-games">
    
                                        <?php 
                    if (!empty($facebook_social)) {
                        ?>
        									<a href="<?php 
                        echo $facebook_social;
                        ?>
" target="_blank" title="'.__('Facebook','tfuse').'"><i class="tficon-facebook"></i> <span>'.__('Facebook','tfuse').'</span></a>
                                        <?php 
                    }
                    ?>
                                        
                                        <?php 
                    if (!empty($twitter_social)) {
                        ?>
          									<a href="<?php 
                        echo $facebook_social;
                        ?>
" target="_blank" title="'.__('Twitter','tfuse').'"><i class="tficon-twitter"></i> <span>'.__('Twitter','tfuse').'</span></a>
                                        
                                    	<?php 
                    }
                    ?>
                                    		</span>
                                    	</div>
                                     <?php 
                }
                ?>
                                    
                                </div>
                            </div>
                        </div>
                        
                       
                    <?php 
            }
            ?>
            <?php 
        }
        ?>
            <?php 
    }
/**
 * Testimonials
 *
 * To override this shortcode in a child theme, copy this file to your child theme's
 * theme_config/extensions/shortcodes/shortcodes/ folder.
 *
 * Optional arguments:
 * title:
 * order: RAND, ASC, DESC
 */
function tfuse_testimonials($atts, $content = null)
{
    global $testimonials_uniq;
    extract(shortcode_atts(array('title' => '', 'order' => 'RAND', 'type' => 'big_slider', 'subtitle' => false), $atts));
    $slide = $nav = $single = '';
    $testimonials_uniq = rand(800, 900);
    if (!empty($order) && ($order == 'ASC' || $order == 'DESC')) {
        $order = '&order=' . $order;
    } else {
        $order = '&orderby=rand';
    }
    $posts = get_posts('post_type=testimonials&posts_per_page=-1' . $order);
    $k = 0;
    if ($type == 'big_slider') {
        foreach ($posts as $item) {
            $k++;
            $slide .= '<li data-testimonial="1">
                <div class="testimonials-text"><p>' . $item->post_content . '</p></div>
                <div class="testimonials-author"><span>' . $item->post_title . '</span></div>';
            if (($from = tfuse_page_options('testimonials_from', '', $item->ID)) != '') {
                $slide .= '<div class="testimonials-organization"><span>' . __('review from', 'tfuse') . '</span> <a href="' . tfuse_page_options('testimonials_url', '#', $item->ID) . '">' . $from . '</a></div>';
            }
            $slide .= '</li>';
        }
        if ($k > 1) {
            $nav = '<a id="testimonials-prev' . $testimonials_uniq . '" class="prev" href="#"><i class="tficon-shevron-left"></i></a>
            <a id="testimonials-next' . $testimonials_uniq . '" class="next" href="#"><i class="tficon-shevron-right"></i></a>';
        } else {
            $single = ' style="display: block"';
        }
        $output = '<section class="testimonials testimonials' . $testimonials_uniq . ' ' . $single . '">
            <div class="container">
                <div class="row">
                    <div class="col-sm-8 col-sm-offset-2">
                        <h3 class="testimonials-title-before">' . $title . '</h3>
                        <h1 class="testimonials-title">' . $subtitle . '</h1>
                        <div class="testimonials-slider">
                            <span class="tficon-apostroufe"></span>
                            <ul id="testimonials' . $testimonials_uniq . '">
                                ' . $slide . '
                            </ul>
                            <div id="testimonials-controls' . $testimonials_uniq . '" class="testimonials-controls"></div>
                        </div>
                    </div>
                    ' . $nav . '
                </div>
            </div>
        </section>
        <script>
            jQuery(document).ready(function() {
                function testimonialsInit() {
                    jQuery("#testimonials' . $testimonials_uniq . '").carouFredSel({
                        swipe : {
                            onTouch: true
                        },
                        next : "#testimonials-next' . $testimonials_uniq . '",
                        prev : "#testimonials-prev' . $testimonials_uniq . '",
                        pagination : "#testimonials-controls' . $testimonials_uniq . '",
                        infinite: false,
                        items: 1,
                        auto: {
                            play: true,
                            timeoutDuration: 10000
                        },
                        scroll: {
                            items : 1,
                            fx: "crossfade",
                            easing: "linear",
                            pauseOnHover: true,
                            duration: 300
                        }
                    });
                }
                testimonialsInit();
                jQuery(window).resize(function() {
                    testimonialsInit();
                });
                var tControlsHeight = jQuery(".testimonials-controls").innerHeight();
                jQuery(".testimonials-controls").css("margin-top" , -tControlsHeight/2);
            });
        </script>';
    } else {
        $output = $class = '';
        if ($type == 'mini_boxed') {
            $class = 'quoteBox';
        }
        foreach ($posts as $item) {
            $k++;
            $slide .= '<div class="slider-item ' . $single . '">
                <div class="quote-text">' . $item->post_content . '</div>
                <div class="quote-author"><span>' . $item->post_title . '</div>
            </div>';
        }
        if ($k > 1) {
            $nav = '<a id="testimonials-prev' . $testimonials_uniq . '" class="prev" href="#"><i class="tficon-shevron-left"></i></a><a id="testimonials-next' . $testimonials_uniq . '" class="next" href="#"><i class="tficon-shevron-right"></i></a>';
        } else {
            $single = ' style="display: block"';
        }
        if ($title != '') {
            $output .= '<h2>' . $title . '</h2>';
        }
        $output .= '<div class="slider slider_quotes ' . $class . '">
            <div class="slider_container clearfix" id="testimonials' . $testimonials_uniq . '">
                ' . $slide . '
            </div>
            ' . $nav . '
        </div>
        <script>
            jQuery(document).ready(function() {
                jQuery("#testimonials' . $testimonials_uniq . '").carouFredSel({
                    next : "#testimonials-next' . $testimonials_uniq . '",
                    prev : "#testimonials-prev' . $testimonials_uniq . '",
                    responsive: true,
                    infinite: false,
                    items: 1,
                    auto: false,
                    scroll: {
                        items : 1,
                        fx: "crossfade",
                        easing: "linear",
                        duration: 300
                    }
                });
            });
        </script>';
    }
    return $output;
}
 * @since The Flavour 1.0
 */
$permalink = get_permalink();
$date_post = tfuse_page_options('event_date');
if (isset($_GET['date']) && $_GET['date'] != '') {
    $date_post = $_GET['date'];
    if (strpos($permalink, "?") === false) {
        $permalink = $permalink . '?date=' . $date_post;
    } else {
        $permalink = $permalink . '&date=' . $date_post;
    }
}
$date = new DateTime($date_post);
$year = $date->format('Y');
$month = $date->format('F jS');
$event_hour = tfuse_page_options('event_hour_min', false, $post->ID);
if (!empty($event_hour)) {
    $hour .= $event_hour['hour'] . ':' . $event_hour['minute'] . ' ' . $event_hour['time'];
} else {
    $hour = '';
}
?>
<article class="post post-details">
    <header class="entry-header">
        <div class="entry-meta">
            <?php 
if (tfuse_options('enable_events_meta', true)) {
    ?>
                <span> <?php 
    _e('Event on ', 'tfuse');
    ?>
Example #19
0
 public function get_seo_meta($set_title = '')
 {
     $theme_name = get_bloginfo('name');
     $theme_description = get_bloginfo('description');
     $title = $theme_name . tfuse_options('seo_title_separator', ' | ') . $theme_description;
     $description = tfuse_options('seo_general_description', $theme_description);
     $keywords = tfuse_options('seo_general_keywords', '');
     $noindex = false;
     $canonical = false;
     if (tfuse_options('seo_use_canonical_url', false)) {
         global $wp_query;
         $url = $this->mrt_get_url($wp_query);
         if ($url) {
             $url = apply_filters('tfuse_seo_canonical_url', $url);
             $canonical = $url;
         }
     }
     $allow_replacements = true;
     if (is_home() || is_front_page() || is_tf_front_page()) {
         $title = tfuse_options('seo_homepage_title', $title);
         $description = tfuse_options('seo_homepage_description', $description);
         $keywords = tfuse_options('seo_homepage_keywords', $keywords);
     } elseif (is_singular()) {
         $current_post_type = get_post_type();
         if ((is_page() || is_single()) && !in_array($current_post_type, array('revision', 'nav_menu_item', 'attachment'))) {
             $title = tfuse_page_options('seo_title', tfuse_options('seo_post_type_' . $current_post_type . '_title', false));
             if (!$title) {
                 $title = the_title('', '', false) . tfuse_options('seo_title_separator', ' | ') . $theme_name;
                 $allow_replacements = false;
             }
             $description = tfuse_page_options('seo_description', tfuse_options('seo_post_type_' . $current_post_type . '_description', $description));
             $keywords = tfuse_page_options('seo_keywords', tfuse_options('seo_post_type_' . $current_post_type . '_keywords', $keywords));
         } elseif (is_attachment()) {
             $title = tfuse_page_options('seo_title', tfuse_options('seo_attachment_title', false));
             if (!$title) {
                 $title = the_title('', '', false) . tfuse_options('seo_title_separator', ' | ') . $theme_name;
                 $allow_replacements = false;
             }
             $description = tfuse_page_options('seo_description', tfuse_options('seo_attachment_description', $description));
             $keywords = tfuse_page_options('seo_keywords', tfuse_options('seo_attachment_keywords', $keywords));
         } else {
             // else ...
             $title_backup = $title;
             $title = tfuse_page_options('seo_title', false);
             if (!$title) {
                 $title = $title_backup;
                 $allow_replacements = false;
             }
             $description = tfuse_page_options('seo_description', $description);
             $keywords = tfuse_page_options('seo_keywords', $keywords);
         }
     } elseif ((is_archive() || is_tax()) && !is_tf_front_page()) {
         if (true) {
             // Archive is parent for all what is under
             if ($get_the_time = @get_the_time()) {
                 $get_the_time .= tfuse_options('seo_title_separator', ' | ');
             } else {
                 $get_the_time = '';
             }
             $title = __('Archive', 'tfuse') . tfuse_options('seo_title_separator', ' | ') . $theme_name;
             $title = tfuse_options('seo_archive_title', $title);
             $description = tfuse_options('seo_archive_description', $description);
             $keywords = tfuse_options('seo_archive_keywords', $keywords);
         }
         if (is_category()) {
             $cat_ID = get_query_var('cat');
             $title = tfuse_options('seo_title', tfuse_options('seo_taxonomy_category_title', tfuse_options('seo_archive_title', false)), $cat_ID);
             if (!$title) {
                 $title = single_term_title('', false) . tfuse_options('seo_title_separator', ' | ') . $theme_name;
                 $allow_replacements = false;
             }
             $description = tfuse_options('seo_description', tfuse_options('seo_taxonomy_category_description', tfuse_options('seo_archive_description', $description)), $cat_ID);
             $keywords = tfuse_options('seo_keywords', tfuse_options('seo_taxonomy_category_keywords', tfuse_options('seo_archive_keywords', $keywords)), $cat_ID);
         } elseif (is_tag()) {
             $title = tfuse_options('seo_taxonomy_post_tag_title', tfuse_options('seo_archive_title', false));
             if (!$title) {
                 $title = single_tag_title('', false) . tfuse_options('seo_title_separator', ' | ') . $theme_name;
                 $allow_replacements = false;
             }
             $description = tfuse_options('seo_taxonomy_post_tag_description', tfuse_options('seo_archive_description', $description));
             $keywords = tfuse_options('seo_taxonomy_post_tag_keywords', tfuse_options('seo_archive_keywords', $keywords));
             $noindex = tfuse_options('seo_taxonomy_post_tag_noindex', false) || tfuse_options('seo_archive_noindex', false);
         } elseif (is_author()) {
             $author = get_userdata(get_query_var('author'));
             $title = tfuse_options('seo_author_title', tfuse_options('seo_archive_title', false));
             if (!$title) {
                 $title = $author->display_name . tfuse_options('seo_title_separator', ' | ') . __('Author Archives', 'tfuse') . tfuse_options('seo_title_separator', ' | ') . $theme_name;
                 $allow_replacements = false;
             }
             $description = tfuse_options('seo_author_description', tfuse_options('seo_archive_description', $description));
             $keywords = tfuse_options('seo_author_keywords', tfuse_options('seo_archive_keywords', $keywords));
             $noindex = tfuse_options('seo_author_noindex', false) || tfuse_options('seo_archive_noindex', false);
         } elseif (is_date()) {
             $title = $this->replace_vars('%%date%%') . tfuse_options('seo_title_separator', ' | ') . __('Date Archive', 'tfuse') . tfuse_options('seo_title_separator', ' | ') . $theme_name;
             $title_backup = $title;
             $title = tfuse_options('seo_date_title', tfuse_options('seo_archive_title', false));
             if (!$title) {
                 $title = $title_backup;
                 $allow_replacements = false;
             }
             $description = tfuse_options('seo_date_description', tfuse_options('seo_archive_description', $description));
             $keywords = tfuse_options('seo_date_keywords', tfuse_options('seo_archive_keywords', $keywords));
             $noindex = tfuse_options('seo_date_noindex', false) || tfuse_options('seo_archive_noindex', false);
         } elseif (is_tax() && ($term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')))) {
             $cat_ID = $term->term_id;
             $taxonomy_type = get_query_var('taxonomy');
             $title = tfuse_options('seo_title', tfuse_options('seo_taxonomy_' . $taxonomy_type . '_title', tfuse_options('seo_archive_title', false)), $cat_ID);
             if (!$title) {
                 $title = !empty($set_title) ? $set_title : single_term_title($term->name, false);
                 $title .= tfuse_options('seo_title_separator', ' | ') . $theme_name;
                 $allow_replacements = false;
             }
             if (!empty($set_title)) {
                 $title = str_replace('%%tag%%', $set_title, $title);
             }
             $description = tfuse_options('seo_description', tfuse_options('seo_taxonomy_' . $taxonomy_type . '_description', tfuse_options('seo_archive_description', $description)), $cat_ID);
             $keywords = tfuse_options('seo_keywords', tfuse_options('seo_taxonomy_' . $taxonomy_type . '_keywords', tfuse_options('seo_archive_keywords', $keywords)), $cat_ID);
             $noindex = tfuse_options('seo_taxonomy_' . $taxonomy_type . '_noindex', false) || tfuse_options('seo_archive_noindex', false);
         } else {
             $noindex = tfuse_options('seo_archive_noindex', false);
         }
     } elseif (is_search()) {
         $title = __('Search Results for ', 'tfuse') . sprintf(__('\'%s\''), $this->request->GET('s')) . tfuse_options('seo_title_separator', ' | ') . $theme_name;
         $title_backup = $title;
         $title = tfuse_options('seo_search_title', false);
         if (!$title) {
             $title = $title_backup;
             $allow_replacements = false;
         }
         $description = tfuse_options('seo_search_description', $description);
         $keywords = tfuse_options('seo_search_keywords', $keywords);
         $noindex = tfuse_options('seo_search_noindex', false);
     } elseif (is_404()) {
         $title = __('Page Not Found - 404 error', 'tfuse') . tfuse_options('seo_title_separator', ' | ') . $theme_name;
         $title_backup = $title;
         $title = tfuse_options('seo_404_title', false);
         if (!$title) {
             $title = $title_backup;
             $allow_replacements = false;
         }
         $description = tfuse_options('seo_404_description', $description);
         $keywords = tfuse_options('seo_404_keywords', $keywords);
     }
     if (is_paged()) {
         $paged_format = tfuse_options('seo_paged_title', false);
         if ($paged_format) {
             $title .= ' ' . trim((string) $this->replace_vars($paged_format));
         }
     }
     return array('title' => $allow_replacements ? $this->replace_vars($title) : $title, 'keywords' => $keywords, 'description' => $this->replace_vars($description), 'noindex' => $noindex, 'canonical' => $canonical);
 }
Example #20
0
 /**
  * aici se schimba pentru fiecare tema spefica de unde ia imaginea, titlul, linkl siderului etc.
  *
  * Note that this function is hooked into the after_setup_theme hook, which runs
  * before the init hook. The init hook is too late for some features, such as indicating
  * support post thumbnails.
  *
  * To override tfuse_slider_type() in a child theme, add your own tfuse_slider_type to your child theme's
  * functions.php file.
  */
 function tfuse_get_slides_from_posts($posts = array(), $slider = array())
 {
     global $post;
     $slides = array();
     $slider_image_resize = isset($slider['general']['slider_image_resize']) && $slider['general']['slider_image_resize'] == 'true' ? $slider['general']['slider_image_resize'] : false;
     foreach ($posts as $k => $post) {
         setup_postdata($post);
         $tfuse_image = $image = null;
         if (!($single_image = tfuse_page_options('single_image'))) {
             continue;
         }
         $image = new TF_GET_IMAGE();
         $tfuse_image = $image->width(960)->height(444)->src($single_image)->resize($slider_image_resize)->get_src();
         $slides[$k]['slide_src'] = $tfuse_image;
         $slides[$k]['slide_url'] = get_permalink();
         $slides[$k]['slide_title'] = get_the_title();
         if ($subtitle = tfuse_page_options('slide_subtitle')) {
             $slides[$k]['slide_subtitle'] = $subtitle;
         } else {
             $slides[$k]['slide_subtitle'] = tfuse_substr(get_the_excerpt(), 50);
         }
         if ($slider['design'] == 'play') {
             $slides[$k]['slide_tab_title'] = tfuse_page_options('slide_tab_subtitle');
         }
     }
     return $slides;
 }
$time = strtotime($post_date);
?>
<article class="post">
    <div class="inner">
        <div class="entry-aside">
           <?php 
$is_arabic = tfuse_page_options('is_arabic');
if ($is_arabic) {
    ?>
        		<div class="arabic" style="direction: rtl;">
        	<?php 
}
?>
            <?php 
$press_author = tfuse_page_options('press_author');
$press_source = tfuse_page_options('press_source');
if ($position == 'before') {
    ?>
                <?php 
    if (!empty($image)) {
        ?>
                	<?php 
        if (!empty($press_source)) {
            ?>
                	    <a target="_blank" class="post-thumbnail <?php 
            echo $img_pos;
            ?>
 clearfix" href="<?php 
            echo $press_source;
            ?>
"><img src="<?php 
Example #22
0
    echo get_the_title();
    ?>
                                    <?php 
    if (!empty($desc)) {
        ?>
                                        <p class="entry-title-min-description"><?php 
        echo $desc;
        ?>
</p>
                                    <?php 
    }
    ?>
                                </h1>
                                    
                                <?php 
    if (tfuse_page_options('join_enable')) {
        ?>
                                    <a href="<?php 
        echo tfuse_options('join_link');
        ?>
" class="btn btn-transparent btn-join-us"><span><?php 
        _e('Join Us', 'tfuse');
        ?>
</span></a>
                                <?php 
    }
    ?>
                            </header>
                        <?php 
}
?>
<?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'));
$art_type = tfuse_page_options('article_type');
if (!empty($image)) {
    if ($art_type == 'post-style-4' || $art_type == 'post-style-3') {
        $image = TF_GET_IMAGE::get_src_link($image, 270, 380);
    } elseif ($art_type == 'post-style-1' || $art_type == 'post-style-2') {
        $image = TF_GET_IMAGE::get_src_link($image, 269, 267);
    }
}
?>
<article class="post <?php 
echo $art_type;
?>
">
    <div class="entry-aside">
        <header class="entry-header">
            
            <?php 
if ($art_type != 'post-style-7') {
    ?>
_e('About', 'tfuse');
?>
</h1> --> 
                                <?php 
if (!empty($posts)) {
    ?>
                                    <?php 
    $k = 0;
    foreach ($posts as $id) {
        ?>
                                    <?php 
        if ($k == get_option('posts_per_page')) {
            break;
        }
        $image = wp_get_attachment_url(get_post_thumbnail_id($id, 'post-thumbnails'));
        $img_pos = tfuse_page_options('single_img_position', '', $id);
        $current_post = get_post($id);
        $user_data = get_user_by('id', $current_post->post_author);
        ?>
                                        <article class="post">
                                            <div class="inner">
                                                <div class="entry-aside">
                                                    <header class="entry-header">
                                                        
                                                    </header>
                                                    <?php 
        if (!empty($image)) {
            ?>
                                                        <a class="post-thumbnail <?php 
            echo $img_pos;
            ?>
Example #25
0
 function tfuse_img_content()
 {
     $content = $link = '';
     $args = array('numberposts' => -1);
     $posts_array = get_posts($args);
     $option_name = 'thumbnail_image';
     foreach ($posts_array as $post) {
         $featured = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID));
         if (tfuse_page_options('thumbnail_image', false, $post->ID)) {
             continue;
         }
         if (!empty($featured)) {
             $value = $featured[0];
             tfuse_set_page_option($option_name, $value, $post->ID);
             tfuse_set_page_option('disable_image', true, $post->ID);
         } else {
             $args = array('post_type' => 'attachment', 'numberposts' => -1, 'post_parent' => $post->ID);
             $attachments = get_posts($args);
             if ($attachments) {
                 foreach ($attachments as $attachment) {
                     $value = $attachment->guid;
                     tfuse_set_page_option($option_name, $value, $post->ID);
                     tfuse_set_page_option('disable_image', true, $post->ID);
                 }
             } else {
                 $content = $post->post_content;
                 if (!empty($content)) {
                     preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $content, $matches);
                     if (!empty($matches)) {
                         $link = $matches[1];
                         tfuse_set_page_option($option_name, $link, $post->ID);
                         tfuse_set_page_option('disable_image', true, $post->ID);
                     }
                 }
             }
         }
     }
     tfuse_set_option('enable_content_img', false, $cat_id = NULL);
 }
 /**
  *
  * Note that this function is hooked into the after_setup_theme hook, which runs
  * before the init hook. The init hook is too late for some features, such as indicating
  * support post thumbnails.
  *
  * To override tfuse_slider_type() in a child theme, add your own tfuse_slider_type to your child theme's
  * functions.php file.
  */
 function tfuse_get_slides_from_posts($posts = array(), $slider = array())
 {
     global $post;
     $slides = array();
     $slider_image_resize = isset($slider['general']['slider_image_resize']) && $slider['general']['slider_image_resize'] == 'true' ? $slider['general']['slider_image_resize'] : false;
     $k = 0;
     foreach ($posts as $k => $post) {
         $k++;
         setup_postdata($post);
         $tfuse_image = $image = null;
         $image = new TF_GET_IMAGE();
         if ($slider['design'] == 'carousel') {
             if ($slider_image_resize) {
                 $tfuse_image = get_the_post_thumbnail($post->ID, 'medium-thumb');
             } else {
                 $tfuse_image = ' <img src="' . wp_get_attachment_url(get_post_thumbnail_id($post->ID, 'post-thumbnails')) . '" width="200" style="height:200px" alt=""/>';
             }
             $title = get_the_title($post->ID);
             $slides[$k]['slide_title'] = $title;
             $slides[$k]['slide_src'] = $tfuse_image;
             $slides[$k]['slide_url'] = get_permalink();
             $slides[$k]['slide_rating'] = tfuse_page_options('rating', '', $post->ID);
             $slides[$k]['slide_enable_rating'] = isset($slider['general']['sliders_posts_rating']) && $slider['general']['sliders_posts_rating'] == 'true' ? $slider['general']['sliders_posts_rating'] : false;
         } elseif ($slider['design'] == 'carousel_medium') {
             if ($slider_image_resize) {
                 $tfuse_image = get_the_post_thumbnail($post->ID, 'carousel-medium-thumb');
             } else {
                 $tfuse_image = ' <img src="' . wp_get_attachment_url(get_post_thumbnail_id($post->ID, 'post-thumbnails')) . '" width="360" style="height:240" alt=""/>';
             }
             $title = get_the_title($post->ID);
             if (mb_strlen($title, 'UTF-8') > 20) {
                 $title = substr($title, 0, 30);
             }
             $slides[$k]['slide_title'] = $title;
             $slides[$k]['slide_src'] = $tfuse_image;
             $slides[$k]['slide_url'] = get_permalink();
         } elseif ($slider['design'] == 'video') {
             $cats = '';
             if ($slider['general']['sliders_posts_from'] == 'video') {
                 $terms = wp_get_post_terms($post->ID, 'videos');
             } else {
                 $terms = wp_get_post_terms($post->ID, 'platforms');
             }
             if (!empty($terms)) {
                 foreach ($terms as $term) {
                     $cats .= $term->name . ', ';
                 }
             }
             $tfuse_image = ' <img src="' . wp_get_attachment_url(get_post_thumbnail_id($post->ID, 'post-thumbnails')) . '" width="75" style="height:75" alt=""  class="video-thumb"/>';
             $title = get_the_title($post->ID);
             $slides[$k]['slide_title'] = $title;
             $slides[$k]['slide_src'] = $tfuse_image;
             $slides[$k]['slide_rating'] = tfuse_page_options('rating', '', $post->ID);
             $slides[$k]['slide_video'] = tfuse_page_options('video_links', '', $post->ID);
             $slides[$k]['slide_cats'] = substr($cats, 0, -2);
         } elseif ($slider['design'] == 'content') {
             if ($slider_image_resize) {
                 $tfuse_image = get_the_post_thumbnail($post->ID, 'content-slider-thumb');
             } else {
                 $tfuse_image = ' <img src="' . wp_get_attachment_url(get_post_thumbnail_id($post->ID, 'post-thumbnails')) . '" width="430" style="height:297" alt=""/>';
             }
             $title = get_the_title($post->ID);
             $slides[$k]['slide_title'] = $title;
             $slides[$k]['slide_src'] = $tfuse_image;
             $slides[$k]['slide_align_img'] = isset($slider['general']['posts_select_align']) && $slider['general']['posts_select_align'] == 'alignleft' ? '' : 'image-right';
             $slides[$k]['slide_url'] = get_permalink();
             $slides[$k]['slide_content'] = tfuse_substr(get_the_excerpt(), 300);
         } elseif ($slider['design'] == 'home') {
             $img = tfuse_page_options('game_header', '', $post->ID);
             if (empty($img)) {
                 continue;
             }
             if ($slider_image_resize) {
                 $image = new TF_GET_IMAGE();
                 $tfuse_image = $image->width(1349)->height(430)->src($img)->resize($slider_image_resize)->get_src();
             } else {
                 $tfuse_image = $img;
             }
             $title = get_the_title($post->ID);
             $slides[$k]['slide_title'] = $title;
             $slides[$k]['slide_src'] = $tfuse_image;
             $slides[$k]['slide_url'] = get_permalink();
             $slides[$k]['slide_button'] = __('READ MORE', 'tfuse');
             $slides[$k]['slide_content'] = tfuse_page_options('description', '', $post->ID);
             $slides[$k]['ios_url'] = tfuse_page_options('ios_link', '', $post->ID);
             $slides[$k]['android_url'] = tfuse_page_options('android_link', '', $post->ID);
             $slides[$k]['facebook_url'] = tfuse_page_options('facebook_link', '', $post->ID);
         }
     }
     wp_reset_postdata();
     return $slides;
 }
<?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 The Flavour 1.0
 */
global $more, $post;
$more = apply_filters('tfuse_more_tag', 0);
$permalink = get_permalink();
$post_type = tfuse_page_options('post_type', '');
$categories_ids = wp_get_post_categories($post->ID);
$categories = '';
if (!empty($categories_ids)) {
    foreach ($categories_ids as $id) {
        $cat = get_category($id);
        $categories .= '<a href="' . get_category_link($cat->term_id) . '" title="' . __('View all posts in', 'tfuse') . ' ' . $cat->name . '" rel="category tag">' . $cat->name . '</a> ';
    }
}
?>
<article class="post <?php 
echo $post_type;
?>
" <?php 
post_class();
?>
>
    <div class="inner">
        <?php 
Example #28
0
        <?php 
}
?>
        <?php 
if ($sidebar_position == 'full') {
    ?>
            <div class="middle-main content-full">
        <?php 
}
?>
 
                    <div id="primary" class="content-area">
                        <div class="inner">
                            <article class="post post-details">
                                <?php 
if (!tfuse_page_options('hide_title')) {
    ?>
                                    <header class="entry-header">
                                        <h1 class="entry-title"><?php 
    echo get_the_title();
    ?>
</h1>
                                    </header>
                                <?php 
}
?>
                                <div class="entry-content">
                                    <?php 
while (have_posts()) {
    the_post();
    ?>
Example #29
0
    ?>
            <div class="col-md-8 col-sm-12 content-area sidebar_right">
        <?php 
}
?>
        <?php 
if ($sidebar_position == 'full') {
    ?>
            <div class="col-sm-12 col-xs-12 content-area">
        <?php 
}
?>
 
                <div class="inner">
                    <article class="post post-details <?php 
echo tfuse_page_options('article_type');
?>
">
                            <?php 
while (have_posts()) {
    the_post();
    ?>
                                    <?php 
    get_template_part('content', 'single');
    ?>
                            <?php 
}
// end of the loop.
?>
 
                    </article>
<?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 Gamezone 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'));
$img_pos = tfuse_page_options('single_img_position');
$position = tfuse_page_options('img_pos');
$post_date = get_the_date();
$time = strtotime($post_date);
?>
<article class="post">
    <div class="inner">
        <div class="entry-aside">
            <?php 
if ($position == 'before') {
    ?>
                <?php 
    if (!empty($image)) {
        ?>
                	<a class="post-thumbnail <?php 
        echo $img_pos;
        ?>
 clearfix" href="<?php 
        the_permalink();