• Just curious.. I have read a lot about how to write a conditional statement where a widget (or hard coded widget) will display only on certain pages.

    I have a website that is run by wordpress but isn’t mainly a blog/ I would like it so that a few of my widgets only show when you are on the blog..

    Now the blog page is called blog, but there are multiple pages, would this code still work?

    <?php
    if (is_page(array('blog'))) { ;?>
    hardcoded widget here
    <?php } ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter lindsayanng

    (@lindsayanng)

    P.s. i tried this code and the answer is that it does NOT work.. because the code between the conditional statements do not show at all

    see here:
    CLICK

    Thread Starter lindsayanng

    (@lindsayanng)

    anyone here manage to show widgets contidionally based on blog or not blog pages?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘COnditional statements for blog/ static content’ is closed to new replies.