Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change frontend wording for bbpress topic views list widget


  • Jerry
    Participant

    @jerrysc

    I thought I was getting good at digging into the codex and css files and using themes to customize, until I tried this. This widget sits in a sidebar and lets the user selects the most popular topics for display, or topics with no replies. I simply want to change the wording for those selections. For example, I want to change “Most popular topics” to “Most Reviewed Books”

    Here is a link to one of my pages. You can see the widget links I want to change under “View List of Books” http://whosgotbooks.com/book-reviews/

    I have tried using firebug to figure out where this is, and done exhaustive word searching within bbpress files. I am at a loss. Please help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • This will do what you after https://gist.github.com/ntwb/8167699 :)

    Pick and choose what you want and remove the rest

    
    /**
     * Register these bbPress views:
     *  - Popular Topics
     *  - Unpopular Topics
     *  - Random Topic
     *  - Recently Closed
     *  - Tagged Test
     *  - All Topics
     *  - Open (Not Closed)
     *
     * @uses bbp_register_view() To register the view
     */
    function ntwb_register_custom_views() {
    	bbp_register_view( 'popular-topics', __( 'Popular Topics' ), array( 'meta_key' => '_bbp_reply_count', 'orderby' => 'meta_value_num' ), false );
    	bbp_register_view( 'unpopular-topics', __( 'Unpopular Topics' ), array( 'meta_key' => '_bbp_reply_count', 'orderby' => 'meta_value_num', 'order' => 'asc' ), false );
    	bbp_register_view( 'random-topic', __( 'Random Topic' ), array( 'orderby' => 'rand' ), false );
    	bbp_register_view( 'closed', __( 'Recently Closed' ), array( 'post_status' => 'closed' ), false );
    	bbp_register_view( 'taggedtest', __( 'Tagged Test' ), array( 'topic-tag' => 'test' ) );
    	bbp_register_view( 'all-topics', __( 'All Topics' ), array( 'order' => 'DESC' ), false );
    	bbp_register_view( 'open', __( 'Open (Not Closed)' ), array( 'post_status' => 'publish' ), false );
     
    }
    add_action( 'bbp_register_views', 'ntwb_register_custom_views' );
    

    Jerry
    Participant

    @jerrysc

    Thanks Stephen. Worked great! At first it did not change the wording of the two primary topic views already listed, but a quick inspection with firebug allowed me to add two more custom views and everything looks great now. Thanks much!

    No problem, and your site is looking good :)

    If you wanted to have a ‘Featured’ view, tag any topic ‘featured’ and change the Tag example view above:
    bbp_register_view( 'featured', __( 'Featured Books' ), array( 'topic-tag' => 'featured' ) );

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.