WordPress tutorial for, How to get page id by slug wordpress theme. First find the page id using page title or page page slug. we given sample code here.
How to get page id by slug wordpress theme
For post title use following code:
<?php $page = get_page_by_title( 'About' ); wp_list_pages( 'exclude=' . $page->ID ); ?>
For post slug use following code:
$page = get_page_by_path( 'your-page-slug' echo $page->ID;
Now List the child page by post slug
if ( $page = get_page_by_path( 'your-page-slug' ) ){ wp_list_pages( 'orderby=name&depth=1&order=DESC&show_count=0&child_of=' .$page->ID . '&title_li=' ); }
I’m really impressed with your writing skills and also with the layout on your weblog.
Is this a paid theme or did you modify it yourself?
Either way keep up the nice quality writing, it’s rare
to see a nice blog like this one these days.
this is not paid theme. I developed myself.
It’s in point of fact a great and helpful piece of
information. I am satisfied that you just shared this useful information
with us. Please keep us informed like this. Thank you
for sharing.