WordPress.org

Support

Support » Plugins and Hacks » wordpress the_date() function

wordpress the_date() function

  • I’m try to distinguish if the post is 7 days old. If it’s older than seven days, then display data1. If the post is not older than 7 days, then display data2. So far I have this:

    if (is_single() && ((int)the_date('d') != (int)date('j') ))
    	{
    		return $data2 ;
    	} else
    		{
    	    	return $data1 ;
    		}
    	}

    Right now when I use this code the actual date gets printed on the post. Since today is the 19th, the number 19 is displayed. I’m not ever sure why it’s displaying the date on the page. Any ideas where I can go with this?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wordpress the_date() function’ is closed to new replies.
Skip to toolbar