A Couple Wordpress Questions for the Advanced Coders

3 replies
  • WEB DESIGN
  • |
Hey guys,

I have a couple questions about implementing a couple things on my Wordpress blogs. In an effort to get better at coding in Wordpress, I'd rather not use plugins to build a recent posts and popular posts tabbed structure to drop in the sidebar.

Does anybody know how to do this? Is there some particular code I have to drop inline to get it to work? Have any links to particular Wordpress functions/classes?

Thanks... and I can provide some code examples if you need.
#advanced #coders #couple #questions #wordpress
  • Profile picture of the author mywebwork
    Not sure if I completely understand - are you just looking for guides for programming WordPress themes or is it more than that?

    If you're just getting started writing (or modifying) themes this link may be useful:

    Developer Documentation WordPress Codex

    Bill
    {{ DiscussionBoard.errors[919357].message }}
    • Profile picture of the author indexphp
      Originally Posted by mywebwork View Post

      Not sure if I completely understand - are you just looking for guides for programming WordPress themes or is it more than that?


      Bill

      Thank for the link, but I'm looking for a loop that will return 10 posts with the most views (popular) and the same for recent posts, so I can put a tabbed thing in my sidebar.
      {{ DiscussionBoard.errors[919655].message }}
  • Profile picture of the author n7 Studios
    You'll need to write a plugin, or use an existing one, because Wordpress doesn't record the view count of every post.

    Your plugin would need to record / increment the view count of a post when it's viewed, and then (if you're using Wordpress 2.8) use the new Widgets API to write a widget, within your plugin code, that you can then drop into a single or multiple dynamic sidebars, to show the top 10 most viewed posts etc.

    I'd suggest approaching this as a plugin, because your plugin can then hook into the Wordpress loop when viewing a post, to increment its view count, and you can also implement multiple instances of widgets - so your home page sidebar might have your widget showing the top 10 viewed posts, whereas your blog page sidebar might have your widget showing the top 5 viewed posts.

    PM me if you require any further help.
    {{ DiscussionBoard.errors[925867].message }}

Trending Topics