• I need to display a special page only on Mondays. I found an older post about changing the page based on the day of the week, but I don’t exactly understand it. I see that I will have to modify the index page of my theme and that’s as far as I got. I’m not a code-y person.

Viewing 4 replies - 1 through 4 (of 4 total)
  • As a starting point, you can do something like this:

    if( date ('N') == 1 ){
        // Show MONDAY's page
        $post = get_post( $monday_post_id );
    }

    That’s a pretty simplified version of what you can do, but that will work.

    Thread Starter janeaniebeanie

    (@janeaniebeanie)

    Thank you. The Muffin Monday page is a PAGE rather than a POST, so would I use $page = get_page etc. ?

    No, you wouldn’t. The code of WordPress doesn’t differentiate between posts and pages like that. As far as it’s concerned, everything is a post so you just stick with the code that I gave above.

    Thread Starter janeaniebeanie

    (@janeaniebeanie)

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Special page on Mondays’ is closed to new replies.