Info
- 2 posts
- 2 voices
- Started 4 years ago by patrace
- Latest reply from _ck_
- This topic is not resolved
Set Topic ID
-
- Posted 4 years ago #
Hi, I'm experimenting with embedding some of the bbPress commenting features into an existing website and I was wondering how to set a topic ID.
If I do something like this it will return the topic title just fine:
$topic = get_topic( 162 );
$topic_id = $topic->topic_id;
echo $topic->topic_title;But as soon as I try something like this I realize that I don't have an active topic because it no longer returns the information:
$topic = get_topic( 162 );
$topic_id = $topic->topic_id;
if (is_topic()) echo $topic->topic_title;Hope that was clear,
Thanks! -
- Posted 4 years ago #
Not quite sure what you are asking/doing buy try adding
global $topic;before your code if you find the function don't know which topic is active. -
You must log in to post.