Linux 软件免费装
Banner图

Flexible Featured Post Widget

开发者 wpmarkuk
更新时间 2015年12月19日 21:29
捐献地址: 去捐款
PHP版本: 4.3.1 及以上
WordPress版本: 4.4
版权: GPLv2 or later
版权网址: 版权信息

标签

widget featured posts

下载

1.0 1.0.1

详情介绍:

This plugin allow you to mark posts (by default) as featured, using a checkbox added to the post edit screen in the Publish meta box. You can then display a random, or the latest, featured post in any sidebar using the widget. The widget provides many flexible options such as choosing whether to display the post meta, featured image and a read more link. Through extensible features, additional widget options can be added and the widget output can easily be customised. Additional there are a number of hooks and filters in place to allow developers to extend the plugin, for example making additional post types have the ability to be featured as well as just posts. You can read the accompanying blog about this plugin here: http://markwilkinson.me/2015/12/flexible-featured-post-widget/

安装:

  1. Upload the plugin files to the /wp-content/plugins/plugin-name directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the 'Plugins' screen in WordPress
  3. Click the Make Featured checkbox in a posts publish meta box
  4. Add the widget to a sidebar in Appearance > Widgets

屏幕截图:

  • The widgets options.

升级注意事项:

Update through the WordPress admin as notified.

常见问题:

Can I change the markup of the widget?

Yes you can easily change the markup. The widgets output is actually controlled by a function hooked into the ffpw_featured_post_output. Therefore to add your own markup you would need to remove the action included, create your own function for the markup (use the one provided as a starting point) and then add your function to the action hook. Take a look at this example which just outputs the featured posts' title linking to the post permalink: ` post_title ); ?> ` https://gist.github.com/wpmark/1f55055ec175cd74d481

Can I add a new field into the widget editor?

This can be done using the built in filter ffpw_widget_options_fields. The following code would add a new textarea for an intro paragraph: ` 'intro_text', 'type' => 'textarea', 'label' => 'Introduction Text', 'desc' => 'Add some introduction text for featured posts here.' ); return $fields; } add_filter( 'ffpw_widget_options_fields', 'wpmark_add_ffpw_intro_field', 9, 1 ); ?> ` You would have to use the action hooks in the widget output function in order to output your new field on the front-end.

更新日志:

1.0.1 1.0