• Resolved stovesy

    (@stovesy)


    Have I got this wrong…

    I can include a page by passing the ID, but not a post…
    So changing this gets it to work – a hack; I’m sure there’s a more elegant way of doing it

    //	query_posts(array('page_id' => $id));
    
    	$post_type = $wpdb->get_var("SELECT post_type FROM {$wpdb->posts} WHERE ID = '{$id}'");
    	if ($post_type == 'page')
    		query_posts(array('page_id' => $id));
    	else if ($post_type = 'post')
    		query_posts(array('p' => $id));
    	else
    		return $r;
    
    	the_post();

    https://www.ads-software.com/plugins/include/

Viewing 1 replies (of 1 total)
  • Plugin Author Michael Flynn

    (@mflynn)

    When I wrote this, page_id worked for posts. Thank you for letting me know that that no longer works for posts, and I will update the plugin to utilize this within the next hour. I will make sure to credit you in the change log.

Viewing 1 replies (of 1 total)
  • The topic ‘Post id include not working.’ is closed to new replies.