Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to mark topic as featured?

  • @valery-kondakoff

    Participant

    Hello!

    I’m setting a news section on my frontpage using the plugin ‘Posts in Sidebar’ which can filter and display topics (with excerpts) by forums and taxonomy. I want to be able to manually mark selected topics as featured (to be displayed on frontage). What is the best practice to do this?

    The easiest way to do this seems to use tags. Say: display on frontage every topic tagged ‘featured’. But how can I limit access to the ‘featured’ tag to admins only, so only admins can set topics as featured?

    Maybe there is a way to set a custom checkbox ‘featured’ to the topic post type to filter the featured posts which will be accessible by admins only?

    Any other ideas? Can you, please, recommend a best way to mark several topics to be included in frontpage?

    Thank you in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • @robkk

    Moderator

    Well not a bbPress specific plugin, but there are a few plugins that can work with custom post types (bbPress uses custom post types).

    A plugin I found and tested is called NS Featured Posts, but like I said many other plugins could possibly work too.

    After installing the plugin make sure to go to Settings > NS Featured Posts and make sure to add the topic custom post type from bbPress in the plugin’s settings.

    Now we can go to Topics > All Topics and see a new column that says Featured. Make sure to click the checkbox near the topic you would want to feature.

    Now we are going to make a custom view to display these featured topics in a topic list, and also be able to display them in pages with a shortcode.

    Add this php code snippet into your child themes functions.php or insert this snippet into a custom plugin like functionality.

    This function displays about 10 featured topics on a single page, change 10 to whatever you want.

    function rkk_register_featured_view() {
     bbp_register_view( 'featured', __( 'Featured Topics' ),  array( 'meta_key' => '_is_ns_featured_post', 'meta_value' => 'yes', 'posts_per_page' => '10', 'max_num_pages' => '1'), false );
    }
    add_action( 'bbp_register_views', 'rkk_register_featured_view' );

    Now in a custom page or widget area that has a widget text area that can handle shortcodes, insert this shortcode.

    [bbp-single-view id='featured']`

    @valery-kondakoff

    Participant

    Hello, Robkk!

    This is a great solution, exactly what I wanted. Thank you a lot for your suggestion and detailed explanation!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar