Forums

struggling with query_post variables (1 post)

  1. charlottek
    Member
    Posted 4 months ago #

    I am trying to use variables to show seasonal categories according to the current month. So that if it is January it shows one category if it is feb it shows a different category.

    I have tried various variations:

    if ('$monthnum=01') {
    	get_posts('cat=6');
    } elseif ( '$monthnum=02') {
    	get_posts('cat=7');
    } endif

    and I tried doing it this way:

    if ( $query_string . 'monthnum=01') {
    	query_posts( 'cat=6');
    } elseif ( $query_string . 'monthnum=02') {
    	query_posts( 'cat=7');

    But it doesn't work - can anyone help?

Reply

You must log in to post.

About this Topic

Tags