Tammu
asked on
Wordpress repeat certain post on certain day of the week
We have regular specials of the day for our diner. I have created all the 7 posts. I am trying to see if there is a way that for example monday's special can show up on the homepage just on every monday of the month. and tuesday's just on tuesday's and so on.
Thanks and appreciate it
Thanks and appreciate it
ASKER
I just want say french toast with fries special for monday to appear only on every monday on the home page once monday is over tuesday's post should appear on every tuesday
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Brilliant that worked perfect thanks
ASKER
Sorry just one more question how to add an and clause to it can query for day and as well as if its breakfast or lunch for example I tried this but did not work
<?php
$currentday = date('l');
$query1 = new WP_Query( array( 'meta_key' => 'weekday', 'meta_value' => $currentday && 'meta_key' => 'whatspecial', 'meta_value' => 'Breakfast' ) );
?>
<?php if ( $query1->have_posts() ) : ?>
<?php while ( $query1->have_posts() ) : $query1->the_post(); ?>
<h2><?php the_title(); ?></h2>
<div><?php the_content(); ?></div>
<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
<?php else: ?>
<p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
<?php endif; ?>
You don't want the post to repost, but instead get sticky for the correct day?