Viewing 6 replies - 1 through 6 (of 6 total)
  • Technokinetics

    (@technokinetics)

    I’m not familiar with the inner workings of Exclude Pages, so can’t help you diagnose the problem, but you might want to try Page Lists Plus, which offers similar functionality but uses a different method and so may not be affected by whatever it is that’s preventing Exclude Pages from working on your site.

    – Tim

    Thread Starter bowoolley

    (@bowoolley)

    Thanks for the suggestion – I tried it, but it didn’t work. (But I’m keeping it, it’s great!) I’ll probably have to use a different theme: the one I’m trying to use calls dp_list_pages and I can’t figure out how to modify that… So no plugins using wp_list_pages have any effect.

    Technokinetics

    (@technokinetics)

    It sounds like your theme uses its own custom function for this; dp_list_pages isn’t a native WP function. Check your functions.php theme file, which is where this function should be defined.

    – Tim

    Hi,
    I have the same problem. The code in funtions.php says:

    ‘# Displays a list of pages
    function dp_list_pages() {
    global $wpdb;
    $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”;
    $pageposts = $wpdb->get_results($querystr, OBJECT);
    if ($pageposts) {
    foreach ($pageposts as $post) {
    ?>

    I was able to solve the problem by adding ” AND $wpdb->posts.post_parent = ‘0’” to the end of the query to exclude all sub pages. I am sure it could be modified to exclude a page by post_id

    OLD
    $querystr = "SELECT $wpdb->posts.ID, $wpdb->posts.post_title FROM $wpdb->posts WHERE $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_type = 'page''

    NEW
    $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'

    In case this does no work, you can do this.

    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: Exclude Pages] Plugin having no effect’ is closed to new replies.