This function doesn’t work:
function remove_ul($ul) {
$ul = preg_replace('/<ul id="general-nav">/', '<ul class="nav">', $ul, 1);
$ul = preg_replace('/</ul>/', '<li class="blank"></li></ul>', $ul, 1);
return $ul;
}
I think because of repeating / on line with </ul>
Any idea?
Thanks.
Try replacing this:
with:
Or try:
Because in your code, you have specified the delimiter
/and then using</ul>, there is conflict, you need to either escape the delimiter with\or use#as delimiters.