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

A Featured Page Widget

外掛說明

This plugin creates a widget that features a specific page, showing its excerpt. You can also choose a post thumbnail among the registered ones in your theme.

Contributing

A Featured Page Widget is available on GitHub. If you want to contribute, please fork it and send a pull request!

Languages

  • Portuguese (Brazil)

螢幕擷圖

  • The widget configuration.

安裝方式

  1. Upload a-featured-page-widget directory to the /wp-content/plugins/ directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Go to ‘Widgets’ menu and drag it to your sidebar

常見問題集

Can I use it outside my sidebar / widget area?

Sure you can! Just call the_widget() wherever you want to display your featured page. If you want to customize it, there’s four arguments:

  • page: The page ID. Required.
  • title: The widget title.
  • image-size: The post thumbnail size.
  • link-text: The text that will replace “Continue reading”. You may leave it empty too.

Example:

<?php
the_widget( 'A_Featured_Page_Widget', array( 'page' => 734, 'link-text' => '', 'image-size' => 'large' ) );
?>

If you don’t know the page ID, you can try get_page_by_path() function:

<?php
the_widget( 'A_Featured_Page_Widget', 'page=' . get_page_by_path( 'about' )->ID );
?>
Can I change the default text “Continue reading”?

Yes. In your functions.php file, you cand use the afpw_link_text filter:

<?php
function mytheme_change_afpw_link_text() {
    return 'Learn more';
}

add_filter( 'afpw_link_text', 'mytheme_change_afpw_link_text' );
?>
Why am I unable to define a manual excerpt for my pages?

First, check if the option for excerpts is not showing under “Screen Options”. If that’s the case, probably your theme doesn’t support excerpts in pages. You need to use add_post_type_support() inside your functions.php file:

<?php
function mytheme_add_page_excerpt() {
    add_post_type_support( 'page', 'excerpt' );
}

add_action( 'init', 'mytheme_add_page_excerpt' );
?>
Who are these three little witches on the banner above?

Arnaldo Baptista, Rita Lee and Sérgio Dias, also known as Os Mutantes, a Brazilian psychedelic rock band of the late ’60s. You should check them out!

使用者評論

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

參與者及開發者

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

參與者

將〈A Featured Page Widget〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

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

變更記錄

1.3

  • Introduce classes generally used for post thumbnails, such as post-thumbnail and entry-image.
  • Update coding standards.

1.2

  • Added widget defaults and removed cache functionality to work correctly with the_widget().
  • Replaced page-link argument with link-text.

1.1

  • Added a filter for the “Continue reading” text.
  • Now we have a FAQ.

1.0

  • First version.