Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

trying to get pages of a particular partent

Discussion in 'Troubleshooting & How-To's' started by Habib Ullah, Apr 18, 2015.

  1. Habib Ullah

    New Member

    Joined:
    Apr 18, 2015
    Messages:
    2
    Likes Received:
    0
    <ul id="latest-vdeos">
    <?php $artists = array( 'posts_per_page' => 50, 'child_of' => 4, 'order'=>'ASC' );
    $artists_lst = get_posts( $artists);
    foreach ($artists_lst as $post ) :
    setup_postdata( $post );
    $post_id=$post->ID; ?>
    <li><a href="#"><?php echo $post_id; ?></a></li>
    <?php
    endforeach; ?>
    </u>
    can anybody help me on this plz
     
    #1
  2. Khurram Shahzad

    Member

    Joined:
    Apr 7, 2015
    Messages:
    30
    Likes Received:
    3
    #2
  3. Habib Ullah

    New Member

    Joined:
    Apr 18, 2015
    Messages:
    2
    Likes Received:
    0
    Khurram, I think every developer first try Google, and if he don't find his required solution then he moves for further options. Anyhow I found my mistake I was using get_post, however get_page is the query to get pages.
     
    #3

Share This Page

Web Hosting