Support » Fixing WordPress » How to display wordpress popular posts outside of wordpress

  • I own a website in which one wordpress blog is a part. I would like to display the popular posts from the blog in the rest of the website. Please let me know how do I go about doing this. Right now I am using the static html generated on the blog to display popular posts on the rest of the site.

    This is my website: VTU Results
    This is my blog: VTU Results Blog

Viewing 1 replies (of 1 total)
  • wpismypuppet

    (@wordpressismypuppet)

    All you have to do is make sure your pages outside of WordPress are .php files (or at least the files you wish to run WordPress stuff on). Then, at the very top of a page outside of WordPress you wish to include WordPress stuff, place this:

    <?php require('/server/path/to/your/wordpress/folder/wp-load.php'); ?>

    Obviously replace the path to your own server’s path. You need wp-load.php in the root of your WordPress install. Once you have that one line of code, you can do any WordPress function, including get_posts(), which is most likely what you’ll need.

Viewing 1 replies (of 1 total)
  • The topic ‘How to display wordpress popular posts outside of wordpress’ is closed to new replies.