Forums

post meta array (2 posts)

  1. narkiej
    Member
    Posted 1 year ago #

    How would I turn the following code into an array. I have lots of meta tags: item1, item2, item3 etc. I want a div to appear if ANY ONE of the aforementioned meta tags is populated.

    <?php if((get_post_meta($post->ID, "item1", true))) { ?>

    EG what i want to achive is:

    <?php if((get_post_meta($post->ID, "item1 OR item2 OR item3", true))) { ?>

    Thank you in advance

  2. alchymyth
    The Sweeper
    Posted 1 year ago #

    have you tried:

    <?php if((get_post_meta($post->ID, "item1", false))) { ?>

    http://codex.wordpress.org/Function_Reference/get_post_meta

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags