• Resolved mooidev

    (@mooidev)


    Hi guys,

    I included the following function into my functions.php page, to remove pages from the listing, but it’s not working.

    // Exclude A-Z Store Directory Pages
    add_action( ‘a_z_listing_item_indices’, ‘exclude_a_z_pages’ );
    function exclude_a_z_pages( $indices, $item, $type )
    {
    if ( in_array( $item->ID, array(
    11639,
    60,
    529,
    7366,
    526
    ) ) ) {
    $indices = array();
    }
    return $indices;
    }

    Any advise?

    Thx.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Dani Llewellyn

    (@diddledani)

    You’ve added the filter as an action hook. Change add_action() to add_filter().

    You also need to specify that your function receives three variables:

    add_filter( 'a_z_listing_item_indices', 'exclude_a_z_pages', 10, 3 );
    
    Thread Starter mooidev

    (@mooidev)

    Thank you! Works like a charm.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Exclude pages’ is closed to new replies.