The effects of alcohol on
sustanon 250 leucine for – real weight loss & bodybuilding benefits?
[Solved] Cannot add php code in theme files
✦ Summarize Topic
✦
✦
✦
AI is analyzing the discussion...
How-to and Troubleshooting
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
Show original
Translating...
Mar 09, 2022 4:42 pm
(@baze)
Active Member
Joined: 4 years ago
Hi guys,
i'm trying to embed the users avatar from jReviews into the comments, so i've created template override which works fine in /wp-content/themes/mytheme/wpdiscuz/layouts/1/avatar.html, but then when i add the php code there nothing happens, only the html is rendered. Can you please let me know how can i sort this out?
thanks,
Baze
Support
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
Show original
Translating...
Mar 10, 2022 12:15 pm
(@asti)
Illustrious Member
Joined: 8 years ago
Hello Baze,
Please let us know what code have you added to the file?
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
Show original
Translating...
Mar 10, 2022 12:47 pm
(@baze)
Active Member
Joined: 4 years ago
Any php code is not rendered, not even a simple echo, and currently i have this but on the front end i don't see anything:
<?php
require_once ABSPATH.'/wp-content/plugins/jreviews/jreviews/framework.php';
S2App::import('Component','userprofiles_profile','jreviews');
S2App::import('Model','everywhere_com_content','jreviews');
$profile = UserprofilesProfileComponent::getOneProfile($userId = null);
echo $profile;
?>
(@baze)
Joined: 4 years ago
Active Member
Posts: 9
Mar 10, 2022 6:03 pm
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
Show original
Translating...
So i've just seen that the system actually puts the code in comments, this is the output:
<!--?php
require_once ABSPATH.'/wp-content/plugins/jreviews/jreviews/framework.php';
S2App::import('Component','userprofiles_profile','jreviews');
S2App::import('Model','everywhere_com_content','jreviews');
$profile = UserprofilesProfileComponent::getOneProfile($userId = null);
echo $profile;
?-->
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
Show original
Translating...
Mar 10, 2022 5:31 pm
(@baze)
Active Member
Joined: 4 years ago
Even this is only showing the avatar and the author name, not the echo
<div class="{AVATAR_WRAPPER_CLASSES}">
{AVATAR}
<div class="auth">{AUTHOR}</div>
<?php echo "baze"; ?>
</div>
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8208
Mar 11, 2022 11:49 am
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
Show original
Translating...
@baze,
This is an HTML file, you can't add the PHP file there. You should create some shortcode like {CUSTOM_SHORTCODE}, use the wpdiscuz_comment_end hook and replace the shortcode in the $commentOutput parameter.