Create parent and children page in Wordpress with BreadCrumb
First go to dashboard create to pages Our History and Our Goal with dummy content and also from sidebar menu select Page attribute parent About us for these pages and publish.
Now we make breadcrumb box dynamic so follow along
I want display current page title in page.php metabox so add below code ->
and save.
Now we want to display breadcrumb in only child pages so follow below code ->
for this we use in get_the_ID() function which return the post page Id and wp_get_post_parent_id() which will check get_the_ID() function return id have parent or not if parent have return Parent ID if not return 0
Now to test lest create another child page in Privacy Policy -> Cookie Policy
and check page you will see static title for that parent page so follow below code change metabox code like below ->
and save..
Comments
Post a Comment