這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Tidyhive Featured Posts

外掛說明

This plugin adds the ability for the user to mark a post to be a featured post with just one click without the need of editing an individual post. The plugin also includes a widget which can display all the posts which have been marked featured.

Usage

  • Go to your admin dashboard page.
  • Open all posts page which displays the list of posts in table.
  • A column name ‘Featured posts’ will be there with a star icon in each row.
  • Click the star to make that post as featured.

Dashboard->Posts>All Posts

Instructions

Q1. How to display feature posts?

Plugin comes with a widget, which can be added to sidebar

Q2. How to display featured posts in any desired section of theme(Developers)?

In order to display featured posts in your theme, use the following code to fetch the posts.

$featured_posts = Thfp_public::thfp_get_featured_posts();

The above code return WP_Query object which you can use in a loop. Above static function accepts a parameter(int) which limits the number of posts which it can return.

Show the posts with the help of custom loop:-

if($featured_posts->have_posts()):
    while($featured_posts->have_posts()): $featured_posts->the_post();
        //Your code here
    endwhile;
endif;

You can also use your own wp_query. Make sure you use ‘tag’ key to be ‘featured’.

$args = array(
    'post_status'   =>  'publish',
    'tag'           =>  'featured',
    //Use any other needed args
);
$featured_posts = new WP_Query($args);

and then use the loop to display posts.

安裝方式

  1. Upload thfp.zip to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress

使用者評論

這個外掛目前沒有任何使用者評論。

參與者及開發者

以下人員參與了開源軟體〈Tidyhive Featured Posts〉的開發相關工作。

參與者

將〈Tidyhive Featured Posts〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄