• Hello Guys
    Few months ago i have buy a premium theme for my web site, but now after update to Wp 2.7 it not working good.

    In this theme an user can insert info in a form (in a page of wp), but in the dropdown menù now not show the categories name but only this 0″ value=”8 (8 is the number of the categories). It’s a big problem for me. Please can help me on this problem?

    The cose is this:

    <?php
    					$cats = wp_dropdown_categories('orderby=name&order=ASC&hide_empty=0&echo=0');
    					$cats = str_replace("\n", "", $cats);
    					$cats = str_replace("\t", "", $cats);
    					$cats = str_replace("<select name='cat' id='cat' class='postform' ><option value=\"", "", $cats);
    					$cats = str_replace("\">", "-", $cats);
    					$cats = str_replace("</option><option value=\"", "_", $cats);
    					$cats = str_replace("</option></select>", "", $cats);
    
    					echo "<select name=\"postcats\" id=\"postcats\">\n";
    							$cats = explode("_", $cats);
    							foreach ($cats as $catsss) {
    								$catsss = explode("-", $catsss);
    								$cat_id = $catsss[0];
    								$cat_name = $catsss[1];
    
    								echo "<option value=\"$cat_id\">";
    									echo $cat_name;
    								echo "</option>\n";
    							}
    					echo "</select>";
    
    					?>

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wp_dropdown_categories not work on wordpress 2.7’ is closed to new replies.