The effects of alcohol on
sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Enable comment form for author and user-role
✦ 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...
Jul 29, 2020 10:38 am
(@3dwan)
Eminent Member
Joined: 6 years ago
Hello,
Is there a snippet to allow only vendor role and author of the post to view the comment form and restrict other visitors and guests from reading the comments?
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...
Jul 29, 2020 12:32 pm
(@asti)
Illustrious Member
Joined: 8 years ago
Hi @3dwan,
you can use the following two options:
In this case, the comments will be visible for the roles, however, they'll not be able to post a comment.
The whole comment section can be hidden for the guests by the following CSS code:
body:not(.logged-in) #comments #wpdcom {
display: none !important;
}
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...
Jul 29, 2020 1:10 pm
(@3dwan)
Eminent Member
Joined: 6 years ago
Thank you for the fast reply, I will add the css code to hide comments from guests, but how do I hide them from other user roles? I have already defined the settings you mentioned but I want comments to be only visible to the author of the post and user-role because comments will act as agreement on services and I don't want the author name to be visible to subscriber user role
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8210
Jul 29, 2020 2:05 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...
@3dwan,
Below is provided an example:
$user = wp_get_current_user();
if ( in_array( 'subscriber', (array) $user->roles ) ) {
comments_template();
}
In this example, the comment section is disabled for the subscriber user role.
The code should be added in the active theme functions.php 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...
Jul 29, 2020 3:09 pm
(@3dwan)
Eminent Member
Joined: 6 years ago
Hello,
I have tried the above snippet and it doesn't work, sorry im not a developer I don't know coding but the above doesn't work.
I am worried if it works it will also disable reviews for products. I need to hide comments for user role on posts only not products.
Thank you a lot on advance
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8210
Aug 01, 2020 1:54 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...
@3dwan,
sorry for the late response.
The code provided by me in this post should be added in the template files of the theme, not in the functions.php file.
For example, in the single.php file, you'll need to find the comments_template(); function and replace it with the code I've provided.
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...
Aug 01, 2020 10:44 pm
(@3dwan)
Eminent Member
Joined: 6 years ago
Hello,
Thank you for your reply, if I provided you with the admin access, could you apply the snippet?
Because I have tried to search for comment_template but I couldn't find it.
Waiting for your reply, thank you in advance
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8210
Aug 07, 2020 12:22 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...
@3dwan,
if I provided you with the admin access, could you apply the snippet?
sure, please send it to info[at]gvectors.com email address.
Please don't forget to leave the email subject here to allow us to easily find it.
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8210
Aug 10, 2020 5:14 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...
Hi @3dwan,
The changes were implemented by our developers. Please check it.
(@3dwan)
Joined: 6 years ago
Eminent Member
Posts: 17
Aug 10, 2020 6:28 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...
@asti hello,
I have checked the changes, and nothing changed. All users can view and see comments instead of limiting access to author and vendor
(@3dwan)
Joined: 6 years ago
Eminent Member
Posts: 17
Aug 10, 2020 8:41 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...
@asti
the comment form doesn't appear for other user roles, but any user who posted an article and has author role, can see comments for all articles, he should be able to see comments for articles he wrote only. and users with role vendor can see comments in all articles. Please help me fix this, as we are very close to solving this issue. also please guide me on which file did you implement the snippet for future reference.
Thank you very very much in advance
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8210
Aug 11, 2020 5:02 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...
@3dwan,
Please help me fix this, as we are very close to solving this issue. also please guide me on which file did you implement the snippet for future reference.
We're really sorry, but there is no easy solution we can provide you. You should ask some developer to do this custom work for you.
(@3dwan)
Joined: 6 years ago
Eminent Member
Posts: 17
Aug 11, 2020 5:17 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...
@asti
Np but can you tell me where were the changes made? In which file?
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8210
Aug 12, 2020 1:07 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...
@3dwan,
There is no only one place where you should make the changes. The changes should be included in several files.
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...
Aug 12, 2020 1:56 pm
(@3dwan)
Eminent Member
Joined: 6 years ago
Hi @3dwan,
The changes were implemented by our developers. Please check it.
I mean these changes, where can I find them?
(@asti)
Joined: 8 years ago
Illustrious Member
Posts: 8210
Aug 14, 2020 1:55 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...
@3dwan,
In almost all files in the inc/post_layout folder in the active theme.
There were added the following code:
$user = wp_get_current_user();
if ( !in_array( 'subscriber', (array) $user->roles ) ) {
comments_template();
}