I am customizing part of a PHP script that outputs HTML based on a previously defined variable ($title), but I'm having some trouble.
This is the code:
$out .= html( "div id='term-list-$taxonomy'", $title .html( "ul id='filter-list' class='term-list'", $list ));
It currently creates this html:
<div id="term-list-taxonomy>
Title
<ul id="filter-list" class="term-list">
<li>Example</li>
</ul>
</div>
...
I'm trying to make it output this (make the title a link):
<div id="term-list-taxonomy>
<a id="filter-title" href="#">
Title
</a>
<ul id="filter-list" class="term-list">
<li>Example</li>
</ul>
</div>
Thanks in advance!
Given what little you've given us about how html()
works, I would speculate that you'd want replace:
$title
with:
html("a id='filter-title' href='#'", $title)
yielding:
$out .= html( "div id='term-list-$taxonomy'", html("a id='filter-title' href='#'", $title) . html( "ul id='filter-list' class='term-list'", $list ));