WordPress.org

Ready to get started?Download WordPress

Forums

SB Child List
How to use it with custom post types? (2 posts)

  1. pinktank
    Member
    Posted 1 year ago #

    How do we use this with custom post types that are hierarchical? It seems to work only with pages. Thanks!

    http://wordpress.org/extend/plugins/sb-child-list/

  2. pinktank
    Member
    Posted 1 year ago #

    Solved it by editing the following with my plugin (though now it is being hijacked on the main page by my function that shows custom types on the main page loop, not sure how to fix this)

    I would suggest adding an option to sb child list settings to make it any, or to use a list of specific post types. I would have committed that code here but I am no good at editing plugin settings.

    Thanks a bunch!

    Line 294

    $sql = 'SELECT ID, post_title, post_type
    			FROM ' . $wpdb->posts . '
    			WHERE
    				post_status = \'publish\'
    				AND post_parent = ' . $id . '
    				AND post_type = \'<strong>dergiden</strong>\'
    			ORDER BY ' . $order;
    
    	if ($children = $wpdb->get_results($sql)) {
    		$return .= $template_start;
    
    		foreach ($children as $i=>$child) {
    			if ($child->post_type == '<strong>dergiden</strong>') {

    Line306

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.