![]() | | ||||||||
| | #1 |
| Custom Join Date: Oct 2007 Location: California
Posts: 835
Thanks: 3
Thanked 140 Times in 93 Posts
|
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. |
| Last edited by indexphp; 06-26-2009 at 12:46 PM. Reason: misspelled | |
| | |
| | #2 |
| Senior Warrior Member War Room Member Join Date: Sep 2008 Location: Honolulu, Hawaii, USA & Montreal Canada
Posts: 2,218
Blog Entries: 1 Thanks: 759
Thanked 724 Times in 505 Posts
|
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 |
| | |
| | #3 | |
| Custom Join Date: Oct 2007 Location: California
Posts: 835
Thanks: 3
Thanked 140 Times in 93 Posts
| Quote:
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. | |
| | |
| | #4 |
| Web Developer, IT Support War Room Member Join Date: Dec 2008 Location: Birmingham, UK
Posts: 513
Thanks: 10
Thanked 77 Times in 65 Posts
|
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. |
| | |
| | |
![]() |
|
| Tags |
| advanced, coders, couple, questions, wordpress |
| Thread Tools | |
| |
![]() |