Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm building a website for a school division in Canada, they help organize their days by assigning a school day to each day of the week. There are 5 school days, and so they do not always end up on the same day of the week, as on a day off the school day doesn't roll over.

I have used a custom post type and entered in custom fields to allow setting a date value, and a School Day Value by the staff of the school, however on the front page I have created a widget that I'd like to run a php string that will find an event with the date value the same as today's date, and then display that day's date or that custom field value in the sidebar for that day.

Can anyone think of how to do this? Thanks!

EDIT*

So from what I can see I think I'd need something like "

$query = new WP_Query( array( 'meta_key' => 'color', 'meta_value' => '**insert something that would show today's date in the  correct format**' ) );

does it seem like I'm headed in the right direction? Sorry guys I know I'm way below the skill set needed for this but I'm not sure how else to learn.

share|improve this question
    
Are you using the Advanced Custom Fields plugin? If not, you should probably remove the tag from your question. –  Pat J Dec 20 '13 at 20:09
    
You'd do this by querying for posts by meta key. Have a look at WP_Query Custom Field Parameters and search around this site for some examples. update your question with code if you need help. –  Milo Dec 20 '13 at 20:56
    
Ok thanks guys I will do. I am using Advanced Custom Fields - and The Events Calendar Plugins. –  Matt Douglas Dec 21 '13 at 2:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.