Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay a custom Wordpress taxonomy tag automatically based on the day of the week?
    primarykey
    data
    text
    <p>I've got a client that wants to display custom taxonomy tags automatically by day of the week in Wordpress. Basically, we'll have a custom post type called "products" and that will have a taxonomy called "day." Within "day" we'll have seven tags, one for each day of the week, and anything tagged with a specific day of the week will display on that day on the home page.</p> <p>So, for example, if Product A, B &amp; C are all assigned a tag of "Wednesday" within the taxonomy "day" and today is Wednesday, then those items will display on the home page. If products D, E &amp; F are assigned Thursday, they'll show up on Thursday, and so on.</p> <p>With all that said, the part I need help with is writing a loop that can detect the day of the week and then query the proper taxonomy tag. Does anyone have any idea how to go about this? I really can't find any reference on this and my PHP skills are rudimentary at best. :-/</p> <p>Here's the loop I'm currently using to display products manually by custom post type, taxonomy &amp; term:</p> <pre><code>&lt;?php query_posts('post_type=products&amp;taxonomy=day&amp;term=wednesday&amp;posts_per_page=10'); ?&gt; &lt;?php if(have_posts()) : while (have_posts() ) : the_post(); ?&gt; &lt;div class="archivecustompost"&gt; &lt;div class="archivecustomleftblock"&gt; &lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark"&gt;&lt;?php the_post_thumbnail( array(150,150) ); ?&gt;&lt;/a&gt; &lt;/div&gt; &lt;div class="archivecustomrightblock"&gt; &lt;h2&gt;&lt;?php the_title(); ?&gt;&lt;/h2&gt; &lt;?php the_excerpt(); ?&gt; &lt;p class="button"&gt;&lt;a href="&lt;?php the_permalink() ?&gt;" rel="bookmark"&gt;Learn More&lt;/a&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;?php endwhile; endif; ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload