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
(@baze)
Posts: 9
Active Member
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...
[#3778]
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
Posted : 09/03/2022 4:42 pm
(@asti)
Posts: 8267
Illustrious Member 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...
Hello Baze,
Please let us know what code have you added to the file?
In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.
Posted : 10/03/2022 12:15 pm
(@baze)
Posts: 9
Active Member
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...
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;
?>
Posted : 10/03/2022 12:47 pm
(@baze)
Posts: 9
Active Member
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...
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>
Posted : 10/03/2022 5:31 pm
(@baze)
Posts: 9
Active Member
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...
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;
?-->
Posted : 10/03/2022 6:03 pm
(@asti)
Posts: 8267
Illustrious Member 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...
@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.
In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.
Posted : 11/03/2022 11:49 am
Super Globals
Options and Features