Forums

COnditional statements for blog/ static content (3 posts)

  1. lindsayanng
    Member
    Posted 2 years ago #

    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 } ?>
  2. lindsayanng
    Member
    Posted 2 years ago #

    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

  3. lindsayanng
    Member
    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.