Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 06-26-2009, 12:46 PM   #1
Custom
 
indexphp's Avatar
 
Join Date: Oct 2007
Location: California
Posts: 835
Thanks: 3
Thanked 140 Times in 93 Posts
Default A Couple Wordpress Questions for the Advanced Coders

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
indexphp is offline   Reply With Quote
Old 06-26-2009, 06:47 PM   #2
Senior Warrior Member
War Room Member
 
mywebwork's Avatar
 
Join Date: Sep 2008
Location: Honolulu, Hawaii, USA & Montreal Canada
Posts: 2,218
Blog Entries: 1
Thanks: 759
Thanked 724 Times in 505 Posts
Default Re: A Couple Wordpress Questions for the Advanced Coders

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
mywebwork is offline   Reply With Quote
Old 06-26-2009, 09:33 PM   #3
Custom
 
indexphp's Avatar
 
Join Date: Oct 2007
Location: California
Posts: 835
Thanks: 3
Thanked 140 Times in 93 Posts
Default Re: A Couple Wordpress Questions for the Advanced Coders

Quote:
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.
indexphp is offline   Reply With Quote
Old 06-29-2009, 04:23 AM   #4
Web Developer, IT Support
War Room Member
 
n7 Studios's Avatar
 
Join Date: Dec 2008
Location: Birmingham, UK
Posts: 513
Thanks: 10
Thanked 77 Times in 65 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile 
Default Re: A Couple Wordpress Questions for the Advanced Coders

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.

n7 Studios is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Website Design

Tags
advanced, coders, couple, questions, wordpress

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 04:14 AM.