I need help with the syntax on how to add a class to the $output variable I need to echo out here. Not good with PHP and I am trying to add a breadcrumb divider so I thought I could do it with css ‘content:’ if only I could add the class. I tried adding &class=something but it didn’t work. Also sticking a ” in the $output variable and that was no good either. Thanks in advance.
$output = wp_list_pages('echo=0&title_li=&child_of=' );
if (is_page( )) {
$page = $post->ID;
if ($post->post_parent) {
$page = $post->post_parent;
}
$children=wp_list_pages( 'echo=0&title_li=&child_of=' . $page );
if ($children) {
$output = wp_list_pages ('echo=0&title_li=&child_of=' . $page );
}
}
echo $output;
If understood right, you can switch to html like this:
Or you can echo HTML in PHP, like this:
UPDATE:
Here is an example:
Will output all arguments inside
<ul>tags.In case you haven’t, check this link for the documentation.