
內容簡介
想要在你最受歡迎的部落格文章中加入特別的訊息或廣告代碼嗎?這個外掛就可以讓你輕鬆實現!
透過 WP-Admin > Plugins 安裝並啟用這個外掛。
在文章編輯器裡使用勾選框標記你的熱門文章為「高級內容」。
前往 WP-Admin > Settings > Reading 編輯你的高級文章訊息。
選擇將你的訊息置於文章內容之上或之下,或是利用 <?php premium_posts(); ?> 範本標籤手動置放在The Loop內。
此外掛還加入了條件標籤 is_premium_post(),以供在佈景主題檔案內使用。你可以傳入文章 ID(或文章物件)作為參數,將其用於判斷特定文章是否被標記為高級內容。
範例:
<?php if ( is_premium_post( $post_id ) ) { ?>
<?php echo get_the_title( $post_id ); ?> 是一篇高級文章!
<?php } ?>
外掛標籤
開發者團隊
原文外掛簡介
Want to add a special message or ad code to your most popular blog posts? This plugin enables you to do just that!
Install and activate the plugin via WP-Admin > Plugins.
Mark your top posts as “Premium” using a checkbox in the Post Editor.
Go to WP-Admin > Settings > Reading and edit your premium post message.
Choose to place your message above or below the post content, or place it manually using the template tag inside The Loop.
This plugin also adds the conditional tag is_premium_post() for use in your theme template files. You can use it to test if a specific post is marked as premium by passing the post ID (or post object) as a parameter.
Example:
is a premium post!
