• I’ve read everywhere & cant find a solution. It seems dp is a big difference from wp. I’ve tried plugins & still wont work. Any ideas how to exclude subpages in header with dp_list_pages code?

    heres my blog https://t-j-e.net/ & i’m tryin to exclude “past interviews in header using dp_list_pages

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter XALFIEX

    (@xalfiex)

    I forgot to mention wp_list_pages(exclude) will not work @ all.

    I just figured out how to do it. This will allow you to exclude them, while ordering them however you want if that is your preference.

    Open up the “functions.php” file for the theme and replace the portion under
    “# Displays a list of pages”. It is located in your theme (/wp-content/themes/{name of your theme’s folder}/functions.php

    Replace:

    $querystr = “SELECT $wpdb->posts.ID, $wpdb->posts.post_title FROM $wpdb->posts WHERE $wpdb->posts.post_status = ‘publish’ AND $wpdb->posts.post_type = ‘page’ ORDER BY $wpdb->posts.post_title ASC”;

    With:

    $querystr = “SELECT $wpdb->posts.ID, $wpdb->posts.post_title FROM $wpdb->posts WHERE $wpdb->posts.post_status = ‘publish’ AND $wpdb->posts.post_type = ‘page’ ORDER BY $wpdb->posts.menu_order ASC”;

    It took me three days to find this, so I figure I’d share. WordPress does not have a great support system, so if you can pass this on, please do. Please copy and paste the link to this post to other inquiries.

    Replace with:
    $querystr = “SELECT $wpdb->posts.ID, $wpdb->posts.post_title FROM $wpdb->posts WHERE $wpdb->posts.post_status = ‘publish’ AND $wpdb->posts.post_type = ‘page’ AND $wpdb->posts.post_parent = 0 ORDER BY $wpdb->posts.menu_order ASC”;

    I add this AND $wpdb->posts.post_parent = 0

    sub can not show

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘how do you exclude subpages in header using dp_list_pages?’ is closed to new replies.