bbPress

Simple, Fast, Elegant

bbPress support forums » Troubleshooting

Not post count but reply count on front page?

(9 posts)
  • Started 2 years ago by Null
  • Latest reply from ardentfrost
  • This topic is not a support question

No tags yet.

  1. 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

    Posted 2 years ago #
  2. -bump-

    Posted 1 year ago #
  3. 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

    Posted 1 year ago #
  4. 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

    Posted 1 year ago #
  5. 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.

    Posted 1 year ago #
  6. 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

    Posted 1 year ago #
  7. then add this in front of your plugin.

    if ( is_front() ) {
    *plugin I mentioned here*
    }

    Posted 1 year ago #
  8. 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

    Posted 1 year ago #
  9. it tests on use of front-page.php in either bb-templates or my-templates.

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.