A3rr0r Pro Manager
Path:
/www/wwwroot/www.smszp.cn/wp-content/themes/boke-x/inc
.
|
Edit
|
Rename
..
|
Edit
|
Rename
all-tags.php
|
Edit
|
Rename
categories-images.php
|
Edit
|
Rename
classes
|
Edit
|
Rename
custom-header.php
|
Edit
|
Rename
customizer.php
|
Edit
|
Rename
extras.php
|
Edit
|
Rename
inc.php
|
Edit
|
Rename
inc_1447.php
|
Edit
|
Rename
inc_2281.php
|
Edit
|
Rename
inc_4059.php
|
Edit
|
Rename
inc_4133.php
|
Edit
|
Rename
inc_5956.php
|
Edit
|
Rename
inc_6616.php
|
Edit
|
Rename
inc_6826.php
|
Edit
|
Rename
inc_8737.php
|
Edit
|
Rename
inc_9849.php
|
Edit
|
Rename
jetpack.php
|
Edit
|
Rename
no-category-base.php
|
Edit
|
Rename
plugins.php
|
Edit
|
Rename
post-like.php
|
Edit
|
Rename
template-tags.php
|
Edit
|
Rename
widgets
|
Edit
|
Rename
'widget-boke-x-views widget_posts_thumbnail', 'description' => __( '显示浏览次数最多的文章', 'boke-x' ) ); // Create the widget. parent::__construct( 'boke_x-views', // $this->id_base __( '» 浏览最多的文章', 'boke-x' ), // $this->name $widget_options // $this->widget_options ); } /** * Outputs the widget based on the arguments input through the widget controls. * * @since 1.0.0 */ function widget( $args, $instance ) { extract( $args ); // Output the theme's $before_widget wrapper. echo $before_widget; // If the title not empty, display it. if ( $instance['title'] ) { echo $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title; } // Posts query arguments. $args = array( 'post_type' => 'post', 'posts_per_page' => $instance['limit'], 'orderby' => 'meta_value_num', 'meta_key' => 'post_views_count', 'post__not_in' => get_option( 'sticky_posts' ) ); // globalize $wp_query global $wp_query; // process the query query_posts( $args ); $i = 1; if ( have_posts() ) { echo '
'; while ( have_posts() ) : the_post(); if($i < 2) { echo '
'; if ( has_post_thumbnail() ) { echo '
' . '
'; the_post_thumbnail('boke_x_widget_thumb'); echo '
' . '
'; } else { echo '
' . '
'; echo '
'; echo '
' . '
'; } echo '
'; boke_x_custom_title(); echo '
'; } else { echo '
' . ($i - 1) . '
'; echo '
'; boke_x_custom_title(); echo '
'; } $i++; endwhile; echo '
'; } wp_reset_query(); wp_reset_postdata(); // Close the theme's widget wrapper. echo $after_widget; } /** * Updates the widget control options for the particular instance of the widget. * * @since 1.0.0 */ function update( $new_instance, $old_instance ) { $instance = $new_instance; $instance['title'] = strip_tags( $new_instance['title'] ); $instance['limit'] = (int) $new_instance['limit']; return $instance; } /** * Displays the widget control options in the Widgets admin screen. * * @since 1.0.0 */ function form( $instance ) { // Default value. $defaults = array( 'title' => esc_html__( '浏览最多的文章', 'boke-x' ), 'limit' => 6 ); $instance = wp_parse_args( (array) $instance, $defaults ); ?>