Skip to:
Content
Pages
Categories
Search
Top
Bottom

Not post count but reply count on front page?

  • Hi,

    On the frontpage (bbpress index) you can see the latest discussions showing: topic, posts, Last Poster, refreshnesses.

    The posts section counts all posts from that topic, INCLUDING the start topic. How can I exclude this first post? So reply = posts count – 1

    Thanx

Viewing 8 replies - 1 through 8 (of 8 total)
  • -bump-

    this is untested…

    make a file in your my-plugin directory and call it whatever you want. Insert the following:

    global $topic;

    add_filter ( 'get_topic_posts', ($topic->topic_posts)-1, $topic->topic_id );

    That should work

    If I don’t wanna use it as a plugin, but hardcode it? Then I put it in index.php? and where in the index.php?

    Thx for the help

    Why wouldn’t you want to use it as a plugin? There’s a filter applied to the reply count call specifically so you can do something like what you’re asking for.

    If you want to hardcode it, you have to go to template-functions.php and find the “get_topic_posts” function and do the -1 there.

    Well I am working on a new page where I want to have this reply function on. If I do this your way or use it as a plugin, it would effect everypage using this option. I only want this on my alternitive index/front-page.php file. Lets call it index2.php.

    So I want this only on my alternitive index page, thats why I want to hardcode it for that page only…

    Thx

    then add this in front of your plugin.

    if ( is_front() ) {

    *plugin I mentioned here*

    }

    is_front stands for front-page.php? And if so how does it know that i use index2.php and not index.php Think i am going to connect index2.php to test.php (thats the renamed original front-page.php)

    Or does this do something completely else, kinda confused :S

    it tests on use of front-page.php in either bb-templates or my-templates.

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