• Hi,
    I am trying to make a template page, where i have couple of excerpt from different pages (which i found on net) but now i want to get the thumbnails related to that page, how do i do that and if i want to learn like writing my own queries. how would i do that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Have a look at the get_posts() function. That will let you query the DB for attachments for a post.

    Thread Starter emaarkhan

    (@emaarkhan)

    I did created a query like this
     $args=array(
      'orderby' =>'parent',
      'order' =>'asc',
      'post_type' =>'page',
      'post__in' => array(8,14,17,19,21,23,25,27),
       );
       $page_query = new WP_Query($args);
      $var_dump($page_query);

    the var dump produces a image. but when i remove var dump nd make it echo it doesnt

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Query to get images from database’ is closed to new replies.