You need to use wp_list_categories()
(Codex ref), using the child_of
argument.
Assuming you know the ID of the “Podcasts” category, e.g. 123
:
wp_list_categories( array(
'child_of' => '123'
) );
If you need to find the category ID, use get_category_by_slug
(Codex ref):
$cat = get_category_by_slug( 'podcasts' );
$catid = $cat->ID;
wp_list_categories( array(
'child_of' => $catid
) );
Rather than executing PHP from within the Page content, I would simply create a custom Page template:
- Copy
page.php
aspage-podcast-list.php
- At the top of
page-podcast-list.php
put the following:
.
<?php
/*
Template Name: Podcast List
*/
?>
- Look for the post content markup (e.g.
<div id="post-<?php the_ID(); ?>" <php post_class(); ?>>
), and replace what’s inside it (should include<?php the_content(); ?>
, etc.) with the$wp_list_categories()
code from above.
If you have problems, copy/paste the code from page-podcast-list.php
in your answer, and we’ll help from there.
EDIT 2
Your parse error is here, inside of your wp_list_categories()
argument array:
'child_of' => $catid;
Should instead be:
'child_of' => $catid
(no semicolon)