2.3.3 提问:为WordPress主题编写⼀个⾃定义⼩部件,实现显⽰最新的博客⽂章和相应的特⾊图像。
编写⾃定义⼩部件⽰例// 创建⾃定义⼩部件class Latest_Blog_Posts_Widget extends fa_Widget {// 构造函数public function __construct() {parent::__construct(); }// 输出⼩部件内容public function widget($args, $instance) { // 查询最新的博客⽂章// 输出⽂章内容if ($latest_posts->have_posts()) {while ($latest_posts->have_posts()) {$latest_posts->the_post();if (has_post_thumbnail()) {echo get_the_post_thumbnail(); }}} }// 注册⼩部件function register_latest_blog_posts_widget() {
10 Screens$8,029
I will design rough sketches for upto 5 Screens of your website/Mobile app.
3 Days
Delivery
1
Revision
- Source File
- Commercial Use
- Interactive Mockup
- 10 Pages
20 Screens$16,029
I will design rough sketches for upto 5 Screens of your website/Mobile app.
- Source File
- Commercial Use
- Interactive Mockup
- 10 Pages
30 Screens$24,029
I will design rough sketches for upto 5 Screens of your website/Mobile app.
- Source File
- Commercial Use
- Interactive Mockup
- 10 Pages