Make use of the exclude
parameter, see Codex: wp_list_pages – parameters.
So for example you do:
$self = $wp_query->post->ID;
and add:
&exclude=$self
to your wp_list_pages
arguments.
Related Posts:
- How to get post category list as select in front-end?
- Build a content and excerpt grid loop with paging and options for # of posts
- How to get the registered sidebar’s name by its id?
- Why does “get_option” pull in the older value in options.php, rather than the newer value, on submission of a form?
- display most popular tags in two columns
- How to add 2 posts under another post? Formatting should be intact
- WordPress menu deletes when trying to add a hook
- Get widget settings function?
- javaScript in section of WP API
- Add before_content and after_content to register_sidebar
- PHP Deprecated: WP_RSSjb has a deprecated constructor
- Use wp_get_recent_posts with search term
- Remove query string specific key value
- How to put a variable in a instance in the widget
- How to prevent WP_Query function from returning all posts when empty?
- Display a specific category of products in shop page and disable code for specific actions
- Get users that likes the post
- Adding a widget function into the php theme file
- Remove echo from shortcode
- Security for data obtained from the database
- Widget back end radio button issue
- WP_Query | IF within $args array | Help me only add specific arguments if the argument is not blank
- My website is not showing Footer section
- change the default order of posts only for specific categories
- Post not populating for custom post type based on category selection
- Custom query vars filters problem with pagination
- Show different website layout if no sidebar added
- Displaying Event within two given time frames
- Add a select-option to the default widgets
- Let current user know pending posts counts using wp_query
- Output product category link from WP_Query
- Isn’t Returning Value While Using SELECT COUNT(*) FROM {$wpdb->prefix}
- “pre_get_posts” orderby custom date field in different format?
- How a HTML form can trigger a PHP function?
- How to exclude meta no index pages from wp_list_pages
- WP query posts BUT show the most recent and one per author
- Ajax filter with loadmore button
- posts_per_page displays only 2 posts instead of 4 posts
- Delete post meta by serialized meta value
- Modify post image in full size
- WP_Query To Display Product Of Brand On Taxonomy Page
- is_user_logged_in() not working in homepage
- Custom Post type Ajax search results
- Customizing the output of the archive and category widget without altering the original behavior of the widget
- Add disclaimer before certain posts and pages
- My query keeps looping infinitely ! how to stop it?
- How can the searchform.php know if it’s used on a registered sidebar id ‘sidebar-1’ or ‘sidebar-2’?
- How can I display a query in a page?
- Display Year and Month from custom field + Age Calculator
- insert thumbnail image from php script
- Weird Behaviour: Not all WordPress Posts appearing
- WordPress – registering sidebar and adding a button directly after .textwidget
- How to get category pages to look like a certain archive page?
- WP Debug enabled Undefined index error in a widget
- How to modify this function to exclude also the post belonging to a specific category?
- a problem in class in class-wp-hook.php
- /page/2/ redirect to 404
- Add adjacent post function inside custom recent post function
- wp_logout action hook is not firing
- Trying to insert widget code into theme function
- Developing a “fallback” for empty wp_query results based on post dates
- Elementor: Exclude product categories when using “Source: Current Query”
- How to speed up a wordpress function with multiple loops?
- How to Display Image Meta underneath EVERY image in EVERY post
- Custom excerpt function re-factoring
- Missing argument 3 for wp_register_sidebar_widget()
- Looking for most performant way to execute several similar WP queries within shortcodes
- API response to be stored locally
- PHP can I add line numbers to file_get_contents()
- Adding tawk.to code just before body tag on functions.php file
- How to change a public function inside a class of a plugin?
- get_the_terms – only top level
- syntax issue on php 7.4
- How do I fetch all comments per post via WP REST API?
- How do I publish only one page to production after making changes on staging?
- Have CSS Class Added with `is_page()` WP function
- Slide in Panel WordPress Post
- Changing Woocommerce flat rate every nth number of items
- Shortcode content output but not in correct place
- Convert all images to PNG on file upload
- WP_Query loop, does not display special characters in title correctly
- How to restrict page access to logged-in users?
- is_page “range” for if statement?
- Calculations in functions.php [closed]
- If search results empty then execute certain code
- Shortcode return function with link href inside PHP
- custom widget on the footer
- Can’t load WP function into external function
- Hide post if matches current month and year
- Count the number of times the search form template gets included on a page
- PHP code inside shortcodes
- Get the last month with posts using a recursive function…
- Limiting woocommerce line_total decimal length
- Add itemprop Schema.org Markup to li Elements in wp_nav_menu
- Use WP_Query in shortcode
- Run a filter when a walker runs
- How can I use wp_insert_comment to write a comment when a post is edited?
- have_posts() execution failure
- Using Multiple Submit buttons to trigger customised php functions
- Removing unneccessary p-tags (Not every p)