highvoltag3
Member
Posted 2 years ago #
I'm using the flowing code to get my categories and put the post for each under them, but the category pluing seems not to get along with it, I tried adding orderby=id to it but the pluing still has no effect over the order any ideas?
Thanks in advanced.`<?php
$categories=get_categories('hide_empty=0&exclude=1');
foreach($categories as $category) {
echo "
";
echo "<li class='nombre_categoria'>".$category->cat_name."";
$category_posts=get_posts('category='.$category->cat_ID);
foreach($category_posts as $post) {
echo '
- guid.'">'.$post->post_title.'
';
};
echo "
";
};
?>`
http://wordpress.org/extend/plugins/my-category-order/
$categories=get_categories('orderby=order&hide_empty=0&exclude=1');
That should work since get_categories calls get_terms just like wp_list_categories.
highvoltag3
Member
Posted 2 years ago #
juliedc
Member
Posted 2 years ago #
I did this a bit differently. First sorted categories with the My Category Order plugin, then added plugin "Drop Down Manager"
Edited wp-content/plugins/dropdown-manager/dropdown_manager.php line 55 to become this:
WHERE dropdown.menu = '" . (int)$num . "' order by terms.term_order ASC;";
Very easy for sorting drop downs but other php files/code would have to be edited for other uses.