<?php
/*** ZanBlog 幻燈片組件** @package ZanBlog* @subpackage Widget*/class Zan_Slide extends WP_Widget {// 設定小工具信息function Zan_Slide() {$widget_options = array('name' => '幻燈片組件(ZanBlog)', 'description' => 'ZanBlog 幻燈片組件' );parent::WP_Widget( false, false, $widget_options ); }// 設定小工具結構function widget( $args, $instance ) { extract( $args );@$id = $instance['id'] ? $instance['id'] : '';$args = array('numberposts' => 6, // 最多獲取6篇文章作為幻燈片'category' => $id,);$postQuery = get_posts( $args );echo $before_widget;?><div class="flexslider hidden-xs"><ul class="slides"><?phpforeach ( $postQuery as $post ) {?><li><div class="col-md-12"><div class="row"><div class="col-md-8"><a href="<?php echo get_permalink($post->ID);?>"><?php echo get_the_post_thumbnail($post->ID, array(500,230)); ?></a></div><div class="col-md-4"><a href="<?php echo get_permalink($post->ID);?>"><div style="font-size:15px;"><?php echo $post->post_title ?></div> </a><br/> <div style="font-size:14px;"><?php echo wp_trim_words($post->post_excerpt,50);?></div></div></div></div></li><?php}?></ul></div><?phpecho $after_widget;}function update( $new_instance, $old_instance ) { return $new_instance;}function form( $instance ) { @$id = esc_attr( $instance['id'] );?><p><label for="<?php echo $this->get_field_id( 'id' ); ?>">文章分類ID:<input class="widefat" name="<?php echo $this->get_field_name( 'id' ); ?>" type="text" value="<?php echo $id; ?>" /></label></p><?php }
} register_widget( 'Zan_Slide' );
?>
/*** 在這里自定義你的CSS代碼*/.zan-outline {color: #110E0E;}.header .logo {border-radius:20%;}nav.navbar-inverse .navbar-nav .avatar-and-username{padding-top: 5px;padding-bottom: 0px;margin-left: 2px;
}
nav.navbar-inverse .navbar-nav .avatar-and-username img {border-radius: 50%;
}
nav.navbar-inverse .navbar-nav .avatar-and-username img:hover {
-webkit-transition: all .3s ease-in-out;
-moz-transition: all .3s ease-in-out;
-o-transition: all .3s ease-in-out;
transition: all .3s ease-in-out;
transform: rotate(360deg);
-moz-transform: rotate(360deg);
-webkit-transform: rotate(360deg);
}
.navbar-form .form-control {border-color: #16a085;
}
.navbar-form .form-control:focus {
border-color: #16a085;
background-color: white!important;
outline: 0;
box-shadow: none;
-webkit-transition: all .3s ease;
-moz-transition: all .3s ease;
-o-transition: all .3s ease;
transition: all .3s ease;
}
本文由 貴州做網站公司 整理發布,部分圖文來源于互聯網,如有侵權,請聯系我們刪除,謝謝!