List child pages, exclude the current page

Question

I’m trying to display the child pages of a parent page, this is working. But when I tried to exclude the current page in the list where the child pages displayed, it’s not working.

How to fix this?

$current_post_id =$post->ID;
if(wp_list_pages("title_li=&child_of=2143&exclude='.$current_post_id.'")): if($title)
echo $before_title .$title . $after_title; wp_list_pages("title_li=&child_of=2143&exclude='.$current_post_id.'");
endif;

0
2 years 2020-01-16T08:38:26-05:00 0 Answers 80 views 0