WordPress get popular posts without any plugins

0

How can I get most popular posts without using any plugins in WordPress.I this post will describes how to get most popular posts without any plugins.

Method-1

Create a custom WordPress Query to get popular posts by limiting 10.

Note

May be you have to displayed an error as following.
[stextbox id=”alert”]Fatal error: Call to undefined function: has_post_thumbnail() in …yourpage.php on line 32[/stextbox] So your theme has to call add_theme_support('post-thumbnails'); in an after_setup_theme action. Otherwise the post-thumbnail functions aren’t included.
1-Go to /wp-content/themes/yourTheme folder.
2-Open the functions.php file.
3-Add add_theme_support('post-thumbnails'); at the end of the page or anywhere and save the file.
4-Reload your site.

Method-2

Simply executes the mysql query and get results.

That’s only!

Share.

About Author

Sumith Harshan is the Web Engineer Specializes in Java Script, JQuery, HTML4/5, CSS2/3, PHP, CodeIgniter, CakePHP, J2SE, J2EE, XML, Hacking & Security, Mobile Interface Developing, Magento, Wordpress, Joomla, Drupal,PHPBB,Facebook App Developing and Open cart...etc.