0

I have made a WordPress theme, and have managed to detect if bbpress is installed or not and I wanted a proper way to see if I was on the forums, list of topics or topic page.

From what I understand the url structures are as such:

  • ?post_type=forum
  • ?forum=test-2
  • ?topic=test

For a very basic install with out the use of sub forms and all that. My question is, would I use GET and or POST or is there some built in wordpress functions I am missing?

I was trying to do:

if('forum' == get_post_type() || 'topic' == get_post_type()){
    echo "I am here"; exit;
}

but that didnt work. So....I am wondering am I missing something?

TheWebs
  • 12,470
  • 30
  • 107
  • 211

1 Answers1

1

Not sure if this still is an issue, but this works for me (WP3.x, bbPress plugin 2.x);

$posttype=get_post_type(); 

if (($posttype=='forum')||($posttype=='topic')) 
  { echo "I am here"; }
Hanzaplastique
  • 564
  • 8
  • 13