0

This is for wordpress. Im using jquery already, and I found this post that creates a filter: Showing posts between a certain date range

this is the direction i feel i would need to follow, unless not. but i understand what filters are but have never had to use them and the wordpress explanation just confusses me. if possible. could someone give a hint as to where in your loop or how one might impliment a filter like this? I think I know what to do, I just cant get wordpress to load only a custom timeframe.please and thank you.

  • I am trying to make an archives page that will allow me to select a year and display the thumbnails of each month's posts as I see fit on the page. I dont want the dynamic/drop down style wordpress already uses. Im doing something much more graphical and would like to have complete control over where and how each month is going to be loaded, placed, and seen. [i have tried every single plugin known to man, i really want control over this please, thank you again!]*
Community
  • 1
  • 1
joacampb
  • 177
  • 1
  • 18

1 Answers1

0

ever heared about query_posts() ? it allows you to alter default queries in any way you want. have a look at this example,

if ( is_home() ) {
    query_posts( $query_string . '&cat=13&monthnum=' . date( 'n', current_time( 'timestamp' ) ) );
}

the above example will show posts for category whose id is 13, for the current month on the main page,

. . it can also be used to fetch an attachment from the particular post, Look,

query_posts( 'attachment_id=5' ); 

you can even join multiple queries very easily. have a look here,

query-posts() in detail

Sufiyan Ghori
  • 18,164
  • 14
  • 82
  • 110
  • I have tried query_posts as well. but i just havnt been able to get the option to, for example, retrieve posts from febuary 2010 only. or something like that. can you define a specific month or time period with query posts instead of using categories or the current month? – joacampb Jan 15 '12 at 19:53
  • for the time being i am going to try and use this from query_posts. ill check back in with progress later $current_year = date('Y'); $current_month = date('m'); query_posts( "cat=22&year=$current_year&monthnum=$current_month&order=ASC" ); – joacampb Jan 15 '12 at 19:57
  • here you go, query_posts( 'year=2004' ); – Sufiyan Ghori Jan 16 '12 at 06:41