Beispiel #1
0
function shiword_search_reminder()
{
    $text = '';
    if (is_archive()) {
        $term = get_queried_object();
        $title = '';
        $type = '';
        if (is_category() || is_tag() || is_tax()) {
            if (is_category()) {
                $type = __('Category', 'shiword');
            } elseif (is_tag()) {
                $type = __('Tag', 'shiword');
            } elseif (is_tax()) {
                $type = __('Taxonomy', 'shiword');
            }
            $title = $term->name;
        } elseif (is_date()) {
            $type = __('Date', 'shiword');
            if (is_day()) {
                $title = get_the_date();
            } else {
                if (is_month()) {
                    $title = single_month_title(' ', false);
                } else {
                    if (is_year()) {
                        $title = get_query_var('year');
                    }
                }
            }
        } elseif (is_author()) {
            $type = __('Author', 'shiword');
            $title = $term->display_name;
        }
        $text = sprintf(__('%s archive', 'shiword'), get_bloginfo('name')) . '<br>' . $type . ' : <span class="sw-search-term">' . $title . '</span>';
    } elseif (is_search()) {
        $text = sprintf(__('Search results for &#8220;%s&#8221;', 'shiword'), '<span class="sw-search-term">' . esc_html(get_search_query()) . '</span>');
    }
    if ($text) {
        ?>
	<div class="meta sw-search-reminder">
		<p><?php 
        echo $text;
        ?>
</p>
	</div>
<?php 
    }
    if (shiword_get_opt('shiword_cat_description') && is_category() && category_description()) {
        ?>
	<div class="meta">
		<p><?php 
        echo category_description();
        ?>
</p>
	</div>
<?php 
    }
    if (is_author()) {
        shiword_post_details(array('date' => 0, 'tags' => 0, 'categories' => 0));
    }
}
Beispiel #2
0
 function widget($args, $instance)
 {
     if (!is_single() || is_attachment()) {
         return;
     }
     extract($args);
     $avatar_size = isset($instance['avatar_size']) ? absint($instance['avatar_size']) : '48';
     $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
     echo $before_widget;
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     shiword_post_details(array('author' => $instance['author'], 'date' => $instance['date'], 'tags' => $instance['tags'], 'categories' => $instance['categories'], 'avatar_size' => $avatar_size, 'featured' => $instance['featured']));
     echo $after_widget;
 }
Beispiel #3
0
 function post_details()
 {
     if (!is_single()) {
         return;
     }
     $output = '<div class="widget tb_post_details">';
     $output .= apply_filters('shiword_mobile_filter_seztitle', __('Post details', 'shiword'));
     $output .= '<div class="widget-body">' . shiword_post_details(array('echo' => 0)) . '</div></div>';
     echo $output;
 }