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
Rating in the post ...
 
Share:
Notifications
Clear all

[Solved] Rating in the post grid / archive page

10 Posts
2 Users
0 Reactions
5,043 Views
Posts: 10
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
(@selenii)
Active Member
Joined: 2 years ago
[#8005]

Can I use the same shortcode in the postgrid/archive page for each post to display the rating of the post? I am using Divi Builder


9 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

Hi 

If you're using the Post Rating Based on Comment Rating Field you can use this shortcode:  https://wpdiscuz.com/community/f-a-q/wpdiscuz-shortcode-2/#post-10665

However, if you're using the Stand-alone Post Rating, unfortunately, there is no available solution at the moment. 


Posts: 10
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
(@selenii)
Active Member
Joined: 2 years ago

Hi, thank you for your feedback. I'm using the Post Rating Based on Comment Rating Field.

Is that the right shortcode for this?

[wpdrating metakey="all" show-lable=false show-count=false show-average=false itemprop=false ]

 


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

@selenii,

Yes it is. 


Posts: 10
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
(@selenii)
Active Member
Joined: 2 years ago

But how can I display it in the loop of divi blog modul? 


5 Replies
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

@selenii,

Here is the code: 

echo do_shordcode('[wpdrating metakey="all" show-lable=false show-count=false show-average=false itemprop=false ]')

(@selenii)
Joined: 2 years ago

Active Member
Posts: 10
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 I doesnt work, when I put this code in the function.php. What I do wrong?

Hier the code for example for the software category.

function add_shortcode_to_posts_in_category($content) {
    // Überprüfe, ob es sich bei dem aktuellen Post um einen in der Kategorie 'software' handelt
    if (is_single() && has_category('software')) {
        // Dein Shortcode, den du zum Inhalt hinzufügen möchtest
        $shortcode = do_shortcode('[wpdrating metakey="all" show-lable=false show-count=false show-average=false itemprop=false]');
        // Hänge den Shortcode an den Inhalt des Posts an
        $content .= $shortcode;
    }
    // Gebe den geänderten (oder unveränderten) Inhalt zurück
    return $content;
}
// Füge den Filter zum 'the_content' hinzu
add_filter('the_content', 'add_shortcode_to_posts_in_category');

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

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

@selenii,

The shortcode must include the post ID to function correctly, especially if it's being displayed on an archive page. Otherwise, it will attempt to retrieve data from the global post, which may not be correct.


(@selenii)
Joined: 2 years ago

Active Member
Posts: 10
Asti
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 But how do I make sure that it is recognized which post it is? The post id should actually be changed dynamically.


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

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

@selenii,

There is not an easy solution we can post here.

Currently, we have paid plugin customization and custom addon development services at the gVectors Team. They can assess the work and create it for you. Just contact us via sales[at]gvectors.com email address and send a list of requirements you'd like to have.


Share: