Wordpress pages and posts all have a unique post ID.This ID allows us to individually change the CSS styling of a particular post or page. It also is useful when working with certain Wordpress plugins such as SEO and sitemaps.So we may want to find out the ID and the easiest way is simply to hover over the post name when looking at the list of posts in the admin section. But another way to have this information readily available is to show the IDs as a new custom column.

post-ids

To add this new column, simply add these lines of code to your childtheme'ss functions.php file:[php]add_filter('manage_posts_columns', 'posts_columns_postpageID', 5); add_action('manage_posts_custom_column', 'posts_custom_columns_postpageID', 5, 2);add_filter('manage_pages_columns', 'posts_columns_postpageID', 5); add_action('manage_pages_custom_column', 'posts_custom_columns_postpageID', 5, 2); function posts_columns_postpageID($defaults){ $defaults['wps_post_id'] = __('post_page_ID'); return $defaults; } function posts_custom_columns_postpageID($column_name, $id){ if($column_name === 'wps_post_id'){ echo $id; } }[/php]

Comments: