WP-PostRatings 只显示评分结果方法
WP-PostRatings 插件使用<?php if(function_exists('the_ratings')) { the_ratings(); } ?>
代码添加评分功能,但这是一个完整模块。如果希望只希望显示评分结果,限制点击评分操作,可以使用<?php echo the_ratings_results( get_the_ID() ); ?>
获取,多余文本在插件模板选项里删除。
另一个方法是直接从数据库获取评分数据输出,方便修改结构样式。在functions.php
主题文件里添加下面代码。
function showRatings($id, $css_class = 'show-ratings') { global $wpdb; $path = plugins_url('wp-postratings/images/'.get_option('postratings_image')); $rating = $wpdb->get_var("SELECT AVG(rating_rating) AS rating FROM $wpdb->ratings WHERE rating_postid = $id"); $i = 0; $html = '<div class="'.$css_class.'">'; if (!empty($rating)) { while ($i < floor($rating)) { $html .= '<img src="'.$path.'/rating_on.gif" alt="" />'; $i++; } if (round($rating, 1) == ($i+0.5)) { $html .= '<img src="'.$path.'/rating_half.gif" alt="" />'; $i++; } } while ($i < 5) { $html .= '<img src="'.$path.'/rating_off.gif" alt="" />'; $i++; } $html .= '</div>'; return $html; }
然后使用<?php echo showRatings( get_the_ID() ); ?>
代码调用。
hydroxychloroquine sulfate tabs https://hydroxychloroquine.webbfenix.com/
dose for acyclovir herpes simplex https://www.herpessymptomsinmen.org/productacyclovir/
ivermectin dosage humans https://ivermectin.webbfenix.com/
starting dose of naltrexone https://naltrexoneonline.confrancisyalgomas.com/
hydroxychloroquine clinical trial results https://hydroxychloroquine.mlsmalta.com/
ivermectin dosing for scabies https://ivermectin.mlsmalta.com/
keflex sinus infection dosage https://keflex.webbfenix.com/
vidalista 5mg cost https://vidalista.mlsmalta.com/
buy zentiva hydroxychloroquine https://hhydroxychloroquine.com/
tadalafil dapoxetine reviews https://dapoxetine.confrancisyalgomas.com/
50mg viagra pills http://droga5.net/
erectile disorder 38 cfr
buy erection pills
erectile enhancement pills
top erectile urologists in san francisco
vidalista without doctor prescription reviews https://vidalista40mg.mlsmalta.com/
nolvadex 10mg https://tamoxifen.mrdgeography.com/
free cialis trial coupon https://wisig.org/
amstyles.com https://amstyles.com/
dapoxetine without a doctor prescription not scam https://ddapoxetine.com/
chloroquine 250 mg tablets https://hydroxychloroquine.grassfed.us/
chloroquine 250 mg tablets https://hydroxychloroquine.mymvrc.org/
quineprox 200 mg https://hydroxychloroquinee.com/
walgreens male enhancement products https://tadalafileo.online/
walgreens male enhancement products https://tadalafil365.online/
does erectile dysfunction ever reverse
erectile dysfunction drugs
are erectile dysfunction pills dangerous
erectile aid device
ed meds
when does erectile dysfunction happen
erectile deformity
vidalista dosage recommendations http://viidalista.co/
buy erectile dysfunction meds
erectile injection video
You have remarked very interesting details! ps nice site. https://local-auto-locksmith.co.uk/kia/
Świetny post. Bardzo ciekawie opisany artykuł. Jak możesz sprawdź stronę o samochodach u mnie! Do zobaczenia! https://samocholand.pl/
taking cefixime without ed https://ceefexime.co/
the best canadian online pharmacies https://edmeds.buszcentrum.com/
the best canadian online pharmacies https://medpills.bee-rich.com/
Thanks for your whole work on this website. My niece takes pleasure in working on research and it is simple to grasp why. We all notice all relating to the powerful ways you render vital tips and tricks via your website and therefore welcome response from website visitors on this topic while our own simple princess is without question understanding so much. Take pleasure in the rest of the year. Your performing a very good job. https://lvagroupinc.com/
Thanks for your own work on this website. My mother take interest in setting aside time for research and it is simple to grasp why. My spouse and i notice all relating to the powerful way you provide very helpful tips via your website and in addition recommend response from visitors on this subject matter while our own simple princess is undoubtedly studying so much. Take pleasure in the rest of the year. You have been performing a tremendous job. https://bupronbupropion.com/
A lot of thanks for all your valuable efforts on this site. Kate loves getting into investigation and it’s really easy to understand why. I know all concerning the dynamic medium you give informative solutions on this web blog and as well as foster participation from others on that content plus our daughter is always discovering a lot. Have fun with the remaining portion of the new year. You are conducting a great job. https://venlorz.com/#
My spouse and i got quite glad that Ervin could deal with his investigations through the ideas he got out of the web page. It’s not at all simplistic to just continually be giving out methods that many other people have been selling. And we also fully understand we have got the website owner to be grateful to for that. The entire explanations you have made, the simple site menu, the friendships you can help foster – it’s got many great, and it’s really helping our son and the family imagine that the issue is entertaining, and that is pretty indispensable. Thank you for everything! https://tofranilimipramine.com/#
My spouse and i got quite glad that John could deal with his preliminary research through the ideas he grabbed out of your web page. It’s not at all simplistic to just continually be giving out methods that many others have been selling. And we also fully understand we have got the website owner to be grateful to for that. The main explanations you have made, the simple site menu, the friendships you can help foster – it’s got many great, and it’s really helping our son and the family imagine that the matter is excellent, and that is pretty indispensable. Thank you for everything! https://tofranilimipramine.com/#
buy cialis without seeing doctor http://ciialis.co/
generic cialis 20 mg price https://cialis.buszcentrum.com/
generic cialis 20 mg price https://cialis.bee-rich.com/
generic cialis 60 mg india https://cialis.studiowestinc.com/
generic cialis 60 mg india https://cialis.adicbc.com/
Touche. Sound arguments. Keep up the amazing work.
Feel free to surf to my blog post; bbq chicken grill aluminum foil
Hello! I realize this is somewhat off-topic however I had to ask.
Does managing a well-established blog like yours require a large amount of work?
I’m brand new to operating a blog however
I do write in my diary on a daily basis. I’d like to start a blog so I will be able to share my
own experience and feelings online. Please let me know if you have any kind of suggestions or tips for new aspiring
blog owners. Thankyou!
My website – grilled chicken steak ala pobre
Thanks designed for sharing such a pleasant idea, piece of writing is fastidious, thats why i have read it
completely
Here is my webpage: pubg jeu
These are genuinely great ideas in concerning
blogging. You have touched some good things here.
Any way keep up wrinting.
Check out my homepage; pubg telecharger gratuit