Looks like a syntax error to me. Try:
wp_list_pages("title_li=&child_of=2143&exclude=$current_post_id")
OR
wp_list_pages("title_li=&child_of=2143&exclude=".$current_post_id)
Also I will suggest to pass parameters as array instead of a string, for better debugging.
wp_list_pages( array(
'child_of' => 2143,
'exclude' => array( $current_post_id ),
);
Make sure $current_post_id
is giving proper value.
Related Posts:
- Create a list of pages excluding children of selected page
- how to properly list child pages in sidebar?
- Get custom field value from Grandparent Page for Parent and Child Pages
- Given the page id, check if it has children
- How to get a list of all recently published child pages?
- WordPress get the child pages of current page
- Show siblings (if any) and parents
- List child pages of current page but limit to specific year
- Child page excerpt
- Create WordPress child page from page actions
- How to show child page without providing ID so it’s dynamic
- is_child() function
- Drop-Down Menu of Current Child Pages
- Get WordPress Child Page IDs
- Displaying the first child page of the parent page
- Adding title and description to subpage’s featured image
- Show list of Child Post in Parent Post
- List subpages in order
- parent page grabbing wrong url for child pages – get_page_uri($pageChild)
- i want to get the parent id, only on parent -> child -> child page
- Exclude child pages args array
- Get first level children of a page ID
- How to get an array of pages ID by some page’s slug and all its children pages in get_posts() function?
- Only one parent page showing
- WordPress Betheme: Unkown subheader image of a child page
- How to disable alphabetical sorting page
- Structure for calling child pages
- Child pages and sub-pages do not appear. Why?
- Add link to parent page in list of child pages
- Display child pages full template including the content
- Listing Child Pages in Random order
- How to display child pages with in a limited child content?
- Display Tags of Child Pages
- Get post_meta of children and compare to current page ID
- Display the latest content from subpages of another page
- Limit the number of child page displaying
- Show the grandmother/father of the childpage
- How to Hard Set the Parent Page in Template
- Website parent child relationship
- How can I clone/copy all fields (post and meta) from parent CPT post to child (with synced fields?)
- wp query to get child pages of current page
- Exclude post ID from wp_query
- Dynamically exclude menu items from wp_nav_menu
- How do I exclude plugins from getting automatically updated?
- Get parent page url to show up when it is in child pages
- Check if is on child-page of a particular page
- Exclude Current Post from Recent Posts Loop
- A check for if is parent page, if has children, if has grandchildren
- Can I have two child pages of different parents with the same name?
- Remove WordPress theme from a specific page
- Create a “Dummy” parent page for a hierarchy in page listing?
- How To Limit Hierarchical Pages Depth (For Custom Post Types) To Children Only
- exclude category from get_posts?
- Exclude Specific Term from Search
- Advanced Custom Fields – Get custom fields from parent page
- Exclude the category from the WordPress loop
- Automatically create child pages when saving a (parent) page
- Display a list of child posts on parent posts of a custom post type
- Skipping first 3 posts in wp query
- Allow only new sub-pages to be created
- 404 on child page when parent page slug is identical to custom post type
- Is there a default template file for child pages / subpages?
- Child Pages Loop
- Prev/Next child navigation for current page?
- Exclude certain category from latest updates
- Get Permalink for the top level parent of child pages
- how can I use WP_Query to exclude a specific tag.?
- How can I programmatically create “child” pages on theme activation?
- Custom user role that can only edit specific (non-custom-type) page and all child pages [duplicate]
- Exclude categories from Loop, queries, widgets, post navigation
- List child pages of a specific page
- Keeping parent menu items active in child pages
- Some pages are missing from the Parent Page select in the Editor
- Create child page within custom post type
- Loop that displays PARENT PAGE & CHILD PAGE & outputs GRANDCHILD PAGE title and content
- Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error
- Remove parent slug for child pages
- Show content if parent page has children
- List posts by category exclude current post
- wp_list_categories exclude not working
- Breadcrumbs showing Parent and Child Pages
- How to filter by category in REST API, excluding posts also in other category term?
- How to display list of child pages of parent page in wordpress?
- Exclude ALL posts from sub categories
- Exclude Tags from get_the_tags
- Delete Child Posts
- Display subpages under parent page as a list within a loop
- Excludes posts that don’t have attachments in the_content()
- Using pagination with get_posts on page type
- Remove parent slug for child pages
- Easy way to process search results before displaying
- Excluding a category from next and previous post links
- Retrieving custom taxonomy in order, but excluding specific tax IDs
- How to exclude/filter a tag from get_the_tag_list()
- get_pages – Display child then grandchild pages
- Exclude post_type from admin comments_list
- Display child pages on a parent and child page using Featured Thumbnails
- is there a quick way to hide category from everywhere?
- Add class to the items in wp_list_pages
- Exclude Category From Home Page, Display Posts on It’s Own Page?