Forums

Join
bbPress Support ForumsPluginsDisplay only if is_front ?

Info

Display only if is_front ?

  1. In bbPress there's a function "<?php bb_location(); ?>" - can this be used to create something like this:

    if ( current page is front page only ) :
    echo "something";
    endif;

    I need to display welcoming box only on my front page, but I don't really understand what this how to use bb_location() for this (if this is possible at all)

  2. There already is a function is_front()

    if (is_front()) {
    // do stuff
    }

    lots of related functions in template-functions.php

    if you need multiple pages, a trick I like to use is

    if (in_array(bb_get_location(),array('topic-page','tag-page','forum-page'))) {
    // do stuff
    }
  3. Hmm - documentation is really needed... :)

  4. Your best bet is to study other plugins.

  5. That's how I'm writing Static Pages plugin now ;).

  6. You must log in to post.