WordPress.org

Support

Support » How-To and Troubleshooting » Show specific category on specific week day

Show specific category on specific week day

  • I’m working on a site that has 7 different users and we want to show each users category on each different day. So on monday I want to show only posts from category 1 on the index-page, on tuesday only posts from category 2 and so on. I’ve got basic knowlege of php-coding, but I don’t get this to work. Can someone help me please!

Viewing 1 replies (of 1 total)
  • I solved it myself with just using this following code before the “have_posts”-coding

    <?php $today = date('N');
    if( $today == 1) : query_posts( 'cat=8' ); { ?>
    <?php } elseif( $today == 2 ) : query_posts( 'cat=5' ); { ?>
    <?php } elseif( $today == 3 ) : query_posts( 'cat=7' ); { ?>
    <?php } elseif( $today == 4 ) : query_posts( 'cat=9' ); { ?>
    <?php } elseif( $today == 5 ) : query_posts( 'cat=10' ); { ?>
    <?php } elseif( $today == 6 ) : query_posts( 'cat=6' ); { ?>
    <?php } elseif( $today == 7 ) : query_posts( 'cat=11' ); { ?>
    <?php } ?>
    
    <?php endif; ?>
Viewing 1 replies (of 1 total)
  • The topic ‘Show specific category on specific week day’ is closed to new replies.
Skip to toolbar