Skip to:
Content
Pages
Categories
Search
Top
Bottom

Display only if is_front ?

  • @thion

    Member

    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)

Viewing 4 replies - 1 through 4 (of 4 total)
  • @_ck_

    Participant

    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
    }

    @thion

    Member

    Hmm – documentation is really needed… :)

    @_ck_

    Participant

    Your best bet is to study other plugins.

    @thion

    Member

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

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