The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Cannot add php code...
 
Share:
Notifications
Clear all

[Solved] Cannot add php code in theme files

6 Posts
2 Users
0 Reactions
1,258 Views
Posts: 9
 Baze
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
(@baze)
Active Member
Joined: 4 years ago
[#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


5 Replies
Asti
Posts: 8208
 Asti
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
(@asti)
Illustrious Member
Joined: 8 years ago

Hello Baze,

Please let us know what code have you added to the file? 


Posts: 9
 Baze
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
(@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;
?>

1 Reply
 Baze
(@baze)
Joined: 4 years ago

Active Member
Posts: 9
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

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;
?-->

Posts: 9
 Baze
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
(@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>

1 Reply
Asti
 Asti
Support
(@asti)
Joined: 8 years ago

Illustrious Member
Posts: 8208
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

@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.


Share: