Vamos falar nesse vídeo sobre como criar um contador de visualizações ➜ Posts Views Counter.
Veja o vídeo
https://www.youtube.com/watch?v=ipd4V99F0Kg
Aqui estão as funções:
function conteudo_antes_depois($content){
if(is_singular( 'post' )){
setPostViews(get_the_ID());
$count = getPostViews(get_the_ID());
$antes = '<div>Aproveite esse conteúdo...</div>';
$apos = '<div>Se você gostou desse conteúdo, deixe seu <a href="#comment">comentário abaixo</a>!</div>';
$content_full = $antes.$content.$apos.'<br>'.$count;
return $content_full;
}else{
return $content;
}
}
add_filter('the_content','conteudo_antes_depois');
function setPostViews($postID){
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
echo '>>>'.$count.'<<<';
if($count==''){
$count = 0;
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, $count);
}else{
$count++;
update_post_meta($postID, $count_key, $count);
}
}
remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
function getPostViews($postID){
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
$count = 0;
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, $count);
return $count . ' Views';
}
return $count . ' Views';
}
function posts_column_views($defaults){
$defaults['post_views'] = __('Views');
return $defaults;
}
add_filter('manage_posts_columns','posts_column_views');
function posts_custom_column_views($column_name, $id){
if($column_name === 'post_views'){
echo getPostViews(get_the_ID());
}
}
add_action('manage_posts_custom_column','posts_custom_column_views', 5, 2);
Baixe o plugin com os códigos no Github – Clique aqui (Download direto).
https://github.com/WP24Horas/Plugins/tree/main/simples-posts-views-count
Views: 9
58 respostas
En büyük orospu cocugu child porn icin ziyaret.
This is really interesting, You’re a very skilled blogger. I’ve joined your feed and look forward to seeking more of your magnificent post. Also, I’ve shared your site in my social networks!
Pretty! This has been a really wonderful post. Many thanks for providing these details.
I truly appreciate your technique of writing a blog. I added it to my bookmark site list and will
Güvenilir bahis siteleri arasında popüler ve Kazançlı bahis deneyimi için en iyi bahis sitelerini keşfedin. Güvenli ve eğlenceli bahis keyfi burada
Although I naturally enjoy your website, I would like to point out that you need to check the spelling of a few of your postings. There are a number of them that are riddled with spelling errors, and to tell you the truth, I find it really annoying. On the other hand, I will definitely come back again in the soon future.
Onwin giriş sizlere Deneme bonusu veren siteler ile yüksek kazanç sağlar. Bonus Veren Siteler listesine göz atmak için hemen sitemize gelin
Hi, Neat post. There’s an issue together with your web site in internet explorer, may test this텶E still is the marketplace chief and a good component of people will pass over your fantastic writing due to this problem.
I loved as much as you’ll receive carried out right here. The sketch is attractive, your authored material stylish. nonetheless, you command get bought an nervousness over that you wish be delivering the following. unwell unquestionably come more formerly again as exactly the same nearly a lot often inside case you shield this hike.
Fantastic site. A lot of helpful info here. I’m sending it to some buddies ans additionally sharing in delicious. And naturally, thanks on your sweat!
This is my first time pay a quick visit at here and i am really happy to read everthing at one place
hi!,I like your writing so much! share we be in contact more approximately your article on AOL? I need a specialist in this area to resolve my problem. Maybe that is you! Looking ahead to see you.
Güvenilir bahis siteleri arasında popüler ve Kazançlı bahis deneyimi için en iyi bahis sitelerini keşfedin. Güvenli ve eğlenceli bahis keyfi burada
casino oynamak cok zevklidir
Fantastic site Lots of helpful information here I am sending it to some friends ans additionally sharing in delicious And of course thanks for your effort
I loved as much as you will receive carried out right here. The sketch is attractive, your authored material stylish. nonetheless, you command get got an impatience over that you wish be delivering the following. unwell unquestionably come more formerly again since exactly the same nearly a lot often inside case you shield this hike.
What i do not understood is in truth how you are not actually a lot more smartly-liked than you may be now. You are very intelligent. You realize therefore significantly in the case of this topic, produced me individually imagine it from numerous numerous angles. Its like men and women don’t seem to be fascinated until it is one thing to do with Woman gaga! Your own stuffs nice. All the time care for it up!
Somebody essentially help to make significantly articles I’d state. This is the first time I frequented your web page and up to now? I surprised with the research you made to make this actual post incredible. Fantastic job!
Hi my family member! I want to say that this post is awesome, nice written and come with approximately all significant infos. I would like to peer extra posts like this.
Just wish to say your article is as surprising. The clearness in your post is just cool and i could assume you’re an expert on this subject. Fine with your permission allow me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please keep up the enjoyable work.
Usually I do not read article on blogs, however I would like to say that this write-up very compelled me to take a look at and do it! Your writing style has been amazed me. Thank you, very nice article.
Thank you I have just been searching for information approximately this topic for a while and yours is the best I have found out so far However what in regards to the bottom line Are you certain concerning the supply
Thank you for the good writeup. It in fact was a amusement account it. Look advanced to far added agreeable from you! However, how could we communicate?
I was recommended this website by my cousin. I am not sure whether this post is written by him as nobody else know such detailed about my trouble. You are amazing! Thanks!
you are truly a just right webmaster. The site loading speed is incredible. It kind of feels that you’re doing any distinctive trick. In addition, The contents are masterwork. you have done a great activity in this matter!
I do not even know how I ended up here but I thought this post was great I dont know who you are but definitely youre going to a famous blogger if you arent already Cheers
Sizin için en iyi güvenilir bahis siteleri bir listesini derledik. Canlı bahislerden casinolarda slot makinesi bahislerine kadar.
Futbol maçları ülkedeki en popüler maçlardır, ancak E-spor turnuvaları da bugün büyük ilgi görmektedir.
Türkiye’de Güvenilir Bahis Siteleri, yarı kutuplu bahis siteleri 2024, yeni bahis siteleri listesi.
Güvenilir ve avantajlı bahisler sunan en iyi ve en güvenli bahis siteleri.
you are in reality a good webmaster. The website loading velocity is amazing. It sort of feels that you’re doing any distinctive trick. Also, The contents are masterwork. you have done a fantastic job in this topic!
Welcome to the future of online shopping! Our e-commerce platform is a virtual storefront where you can explore, compare, and effortlessly purchase a wide array of products at the click of a button
Elevate your online shopping journey with us. Immerse yourself in a world of unparalleled variety, exclusive deals, and a secure, user-friendly interface that makes every purchase a delight
Thanks for another excellent post. Where else may anyone get that kind of information in such an ideal means of writing? I’ve a presentation next week, and I am at the search for such info.
Sizin için en iyi güvenilir bahis siteleri bir listesini derledik. Canlı bahislerden casinolarda slot makinesi bahislerine kadar.
I loved as much as you’ll receive carried out right here. The sketch is attractive, your authored material stylish. nonetheless, you command get bought an nervousness over that you wish be delivering the following. unwell unquestionably come more formerly again as exactly the same nearly a lot often inside case you shield this hike.
My brother recommended I might like this web site. He was totally right. This post actually made my day. You cann’t imagine just how much time I had spent for this information! Thanks!
very nice post admin
https://www.specialtysewingyuma.com/
Its like you read my mind You appear to know so much about this like you wrote the book in it or something I think that you can do with a few pics to drive the message home a little bit but other than that this is fantastic blog A great read Ill certainly be back
thank you admin very nice blog
Deneme bonusu veren siteler boyle kahpe gormedi
I do trust all the ideas youve presented in your post They are really convincing and will definitely work Nonetheless the posts are too short for newbies May just you please lengthen them a bit from next time Thank you for the post
What i dont understood is in reality how youre now not really a lot more smartlyfavored than you might be now Youre very intelligent You understand therefore significantly in terms of this topic produced me personally believe it from a lot of numerous angles Its like women and men are not interested except it is one thing to accomplish with Woman gaga Your own stuffs outstanding Always care for it up
Hello, Neat post. There’s an issue together with your site in internet explorer, would check this텶E still is the marketplace chief and a large element of other folks will leave out your magnificent writing due to this problem.
Fantastic site. A lot of helpful info here. I’m sending it to some buddies ans additionally sharing in delicious. And naturally, thanks on your sweat!
Hi, i think that i saw you visited my web site thus i came to ?eturn the favor텶’m attempting to find things to enhance my site!I suppose its ok to use a few of your ideas!!
I loved as much as you will receive carried out right here The sketch is attractive your authored material stylish nonetheless you command get got an impatience over that you wish be delivering the following unwell unquestionably come more formerly again since exactly the same nearly a lot often inside case you shield this hike
zanetvize.com
이 시대에 거기에 가는 것은 단순히 고통입니다.
Experience Excellence with Bwer Pipes: Elevate your farming operations with Bwer Pipes’ industry-leading irrigation solutions. Our cutting-edge sprinkler technology and durable pipes are engineered for superior performance, enabling Iraqi farmers to achieve optimal water management, crop health, and productivity. Explore Bwer Pipes
child porn
buying prescription drugs in mexico: Online Pharmacies in Mexico – pharmacies in mexico that ship to usa
buy prescription drugs from india http://indiaph24.store/# indian pharmacy online
india online pharmacy
Bwer Pipes: Pioneering Irrigation Excellence in Iraq: Explore Bwer Pipes for cutting-edge irrigation solutions that set the standard for excellence in Iraqi agriculture. Our advanced sprinkler technology and durable pipes deliver precise water distribution, enabling farmers to achieve optimal crop yields and sustainable farming practices. Explore Bwer Pipes
Optimize Your Farm’s Water Management with Bwer Pipes: Bwer Pipes offers a comprehensive range of irrigation solutions designed to help Iraqi farmers maximize water efficiency. Our reliable sprinkler systems and durable pipes ensure uniform water distribution, promoting healthier crops and sustainable farming practices. Explore Bwer Pipes
mexico drug stores pharmacies: buying prescription drugs in mexico – pharmacies in mexico that ship to usa
https://mexicoph24.life/# reputable mexican pharmacies online
https://canadaph24.pro/# canadian drugs