I am a complete noob in PHP, and have no idea how to call certain functions and what not. I have a widget on my website that displays in tabs the most recent post/popular post/comments/tags. For the "popular" tab it shows my posts that has the most comments and goes as far back to posts I created a year ago. I would like to make it so that it only shows the most popular post in a week span, and possibly the one with the most page views instead of comments.
I do know I have to go into my theme.functions.php, but I am not exactly sure where and what I put in to do this. Can anyone please provide me with some help?