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
- Inject post (from specific category) between posts in Loop
- Calling a method from functions.php on a click of a button
- How to change featured content to a different tag in WordPress Twenty Fourteen?
- How do I create comment-reply-button using element not
- How to display custom field on homepage
- Making Quote Plugin more efficient
- How to do multiple searches (with logical OR) in WP_Query in hook pre_get_posts?
- allow subscribers to see private posts without plug in
- How to securely provide a $_POST var in WP_Query with PHP 7?
- If Query In Sidebar
- Fatal error: Uncaught Error: Call to undefined function test()
- Return a numerical function value in Customizer controls
- How can I get the values of my WordPress $wpdb query in Jquery?
- theme_root returning a truncated URI
- Echo string and function?
- Adding wrapper elements in the_date() like in the_title()?
- Plugin Generate Unexpected output during activation
- PHP code for displaying WordPress posts in a static page not working
- How to override url params with rewrite rules vars?
- How to add data to a custom field at the wp_users table?
- How to make a cookie be on the whole site instead of being on a specific page/
- Child Theme’s Read More Text
- call a string/function from database
- Get date function not working
- WP_Query – How to query all of post types categories
- How to work Woocommerce pagination inside shortcode?
- Trying to add Custom Post Type to this functions.php command
- Apply function.php filter only if url not has /amp/
- custom post type column countdown
- Creating wordpress user registration form
- Add missing alt tag to featured images for “storefront” theme
- Load admin bar without wp_head or wp_footer [duplicate]
- Highlight Single Page Ancestor
- Registration form not registering First and Last name
- Removing get_template_part in child theme
- Edit the Publish Widget Options
- WordPress post pagination on custom template not working
- Ajax Load More or View More functionality for woocommerce category layout by template overriding
- Contact form with dynamic dropdown and filter
- Alternative to php echo within code
- Add multiple HTML attributes to an Elementor button
- How to sort custom sortable column by custom table value