Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter tomconte

    (@tomconte)

    You’re right, that is certainly the reason why. Thanks!

    What’s the proper way of excluding the current month from display? I have it set up like this:

    <? foreach(array_slice($months,1) as $this_month) : ?>

    Not sure if I will experience problems down the road due to the array becoming larger over time. Any suggestions? I’m curious to see if there is a better way.

    Fancy I see you here. It seems we both are pondering the same thing. Well, I found a solution although I’m having problems with actual date it is interpreting (today is the 21st, but all of sudden it’s declaring itself as tomorrow 22nd).

    Anyways, here is what I have to display posts published for “Today”:

    // Capture today's date
    $today = getdate();
    
    // Set WP Query arguments
    $argsT = array(
    	'cat'=>3,
    	'year'=>$today["year"],
    	'monthnum'=>$today["mon"],
    	'day'=>$today["mday"]
    	);
    
    // Create a new instance of the object
    $todayQuery = new WP_Query($argsT);
    
    // Loop through posts published "Today"
    <?php if ($todayQuery->have_posts()) : ?>
    <?php while ($todayQuery->have_posts()) : $todayQuery->the_post(); ?>
    <a href="<?php echo $link; ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
    <?php endwhile; ?>

    My only problem is the getdate() function is much faster than what the actual time is….not sure why but I’m still figuring that out.

Viewing 3 replies - 1 through 3 (of 3 total)