AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Closed] How can I make a piece of code show up only for one topic?

5 Posts
2 Users
1 Reactions
1,395 Views
Posts: 42
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@needurhelp)
Trusted Member
Joined: 7 years ago
[#13793]

Like:

if (topic id = 23) {

code here

}

 

4 Replies
Alvina
Posts: 1857
Moderator
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@alvina)
Member
Joined: 7 years ago
I'm sorry but we don't follow you well. Please let us know what you want to show the data array of the topic or the fully designed topic?
If you mean topic array, then you should use the following code:
<?php wpforo_topic($topicid) ?>

3 Replies
(@needurhelp)
Joined: 7 years ago

Trusted Member
Posts: 42
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@alvina Sorry, I meant if a user visits a certain topic like topic id 332

it will show a piece of code for that topic for example a Google Analytics script.

Something like:

if (wpforo_topic($topicid) == 332) {
/* code goes here */
}

Alvina
Moderator
(@alvina)
Joined: 7 years ago

Member
Posts: 1857
Alvina
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@needurhelp,

Sorry for the late response.

You should use the following code:

if( WPF()->current_object['topicid'] == 332 ) {
/* code goes here */
}

(@needurhelp)
Joined: 7 years ago

Trusted Member
Posts: 42
Alvina
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@alvina thank you!


Share: