At the moment my nav menu’s category list only links to normal post_type archives. I’d like to dynamically append a custom post type, specifically ?post_type=portfolio, to the end of each url that particular drop down list. But I really don’t know anything about php regex at the moment, except that I think that’s what I need for it to work.
For example, instead of http://pixelsandtea.com/category/print/, I need it to be http://pixelsandtea.com/category/print/?post_type=portfolio.
This is the code I’ve got in my functions.php file so far, specifically for the nested drop down list in question. As you can see, my theme appends the categories post count after the end of the link, and I’d like to keep it there please.
$folio = wp_list_categories(‘show_count=1&echo=0&child_of=86&title_li=Portfolio‘:wink:;
$folio = preg_replace(‘/</a> ((.*))/’,’ <span>$1</span>’,$folio);