Query_Posts and date function doesn't fork correctly
-
Hi there..
I am trying to bring the posts for a specific date (I have more than for that day). I spent a lot of time in the forums and found some solutions.
The code below looks like working:
<?php $current_year = date('Y'); $current_month = date('m'); $post_query = 'cat='.$cat1_id.'&posts_per_page=3&offset=1&year=$current_year&monthnum=$current_month&day=15'; ?> <?php query_posts( $post_query ); ?>But when i change the specific day (19) with current day function, it fails to work:
<?php $current_year = date('Y'); $current_month = date('m'); $current_day = date('j'); $post_query = 'cat='.$cat1_id.'&posts_per_page=3&offset=1&year=$current_year&monthnum=$current_month&day=$current_day'; ?> <?php query_posts( $post_query ); ?>I tried to debug and used
<?php echo $current_day; ?>and it works flawlessly, shows the proper day (19).I have to use the function to grab the current day… But somehow it does not work.
Do you have any idea about what i am missing?
Thx
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
The topic ‘Query_Posts and date function doesn't fork correctly’ is closed to new replies.