1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

wordpress custom field multiple meta_key values help please

Discussion in 'PHP' started by macaela, Sep 10, 2014.

  1. #1

    I have this function that display a menu based on custom field but it only works if the met_key is one value I want to be able to display the menu depend on two value like

    if meta_key == empty or meta_key == switch_on

    I tried to use the compare sintax but ddoesnt not work
    this is my code

      wp_list_pages( array(
      'meta_key' => 'extra_menu', // custom field name
      'meta_value' => 'thememenu', // value of the custom menu you want the menu to display only if custom field is equal to   
      'child_of'=>get_post_top_ancestor_id()) );
    macaela, Sep 10, 2014 IP