w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to show only the parent page title if it has child pages in wordpress

You can acheive this using the wp_list_pages() function.

The function offers many more arguments, but the one I think you need is include -

include (string) Only include certain Pages in the list generated by wp_list_pages. Like exclude, this parameter takes a comma-separated list of Page IDs. There is no default value. See the Include Pages in List example below.

So assuming your ID's for the pages HTML and CSS are 6 and 8 (change as necessary), you'd use -

$args = array(
    'include' => '6,8'
);
wp_list_pages($args);




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.