예제 #1
0
 function __construct()
 {
     parent::__construct();
     global $post;
     if (isset($post->ID)) {
         switch (wfx_info_location('')) {
             case 'home':
                 $this->share_url = home_url();
                 break;
             case 'single' || 'page':
                 $this->share_url = isset($post->ID) ? get_permalink($post->ID) : home_url();
                 break;
             default:
                 $this->share_url = home_url();
                 break;
         }
     }
     $this->gplus_id = 0;
     $this->fb_like_id = 0;
     $this->twit_like_id = 0;
     $this->share_site_name = wp_strip_all_tags(get_bloginfo('name', 'raw'));
     $this->share_title = isset($post->ID) ? wp_strip_all_tags(get_the_title($post->ID)) : wp_strip_all_tags(get_bloginfo('name', 'raw'));
     $this->share_description = wp_strip_all_tags(get_bloginfo('description', 'raw'));
     $this->og_image = apply_filters('wflux_social_og_meta_image', WF_THEME_URL . '/images/supporting/social_thumbnail.jpg');
 }
예제 #2
0
파일: loop.php 프로젝트: bdacode/Wonderflux
<?php

/**
 * Wonderflux loop template part
 *
 * Customise this in your child theme by:
 * - Using hooks and your own functions
 * - Using the 'loop' template part 'loop-404.php' (location specific) or 'loop.php' (fallback if location specific file not available)
 * - Using the 'loop-content' template part 'loop-content-404.php' or 'loop-content.php' (fallback if location specific file not available)
 * - Copying this file to your child theme and customising - it will over-ride this file
 *
 * @package Wonderflux
 */
$hook_where = wfx_info_location();
wfloop_before();
//WF display hook
if (!have_posts()) {
    // No posts found
    if (is_search()) {
        get_template_part('loop-content', 'no-search-results');
    } else {
        get_template_part('loop-content', '404');
    }
} elseif (isset($_GET['s']) && trim($_GET['s']) == '') {
    // If no query supplied, show no results - dont like this, just override in child theme!
    get_template_part('loop-content', 'no-search-results');
    query_posts('showposts=0');
    // Reset post data so page counters show incorrectly - no results = no paged results thanks!
} else {
    wfloop_before_found_posts_all();
    $wfloop_before_found = 'wfloop_before_found_posts_' . $hook_where;