WordPress.org

Ideas

get_pages() - exclude argument not working for me

  1. Assignment Guarantee
    Member

    Hi,

    I searched for my query since last 6 days but unable to find any proper solution and now writing here. May be getting some solution from here.

    I want to use get_pages() function in one of my page. This page will suppose to show list of all pages of my offered services. Therefore, I think this function is useful. I wrote a function as a shortcode and add it in the page named "Services". While listing, I wished that some of the basic pages of website exclude from the list i.e. about, policy, contact, etc. An argument "exclude" is a problem in using this wp function.
    As there are more than one pages need to exclude, I tried below ways:
    a) previous argument, 'exclude' => '4,15,60', next argument
    b) previous argument, 'exclude' => '4','15','60', next argument
    c) previous argument, 'exclude' => array('4','15','60'), next argument
    d) previous argument, 'exclude' => array(4,15,60), next argument
    e) previous argument, 'exclude' => array('4,15,60'), next argument

    I am fail to exclude these pages via any of above method.

    Somebody, please help me to identify the solution without suggesting any plugin.

    Posted: 3 months ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    0 Votes
  • Status

    This idea is under consideration