Skip to:

Check if on page/blog or forum

  • koendb


    Short question: How do I check if I’m on a page (or blog) from within ‘loop-single-reply.php’?

    WP 3.8.3
    bbpress 2.5.3

    Long question: I use bbpress for all my comments on articles and blogs: ‘Use a bbPress forum topic for comments on this post.’

    On my website this generates a first post along the lines of (my website is in Dutch): ‘This topic belongs to article <LINK>. Share your thoughts!’

    This text is visible both under the actual article and on the forums. While it’s a good way to explain the purpose of the thread on the forums, it’s confusing as the first reply on the actual article page. Because of that I don’t want to show this first reply on all my blog / page ‘pages’, but do want to show them on the forums.

    It’s fairly easy to remove the first reply within ‘loop-replies.php’, but I don’t know how to test whether I’m on the forums or not? Is_page doesn’t work, is_bbpress always returns true.

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