Hot answers tagged

2

Notes: Currently you're echo-ing the output of wp_get_archives(). In order to return it, we must set the echo input parameter to false. You're assuming the output of wp_get_archives() is an array, but it's a string. Workaround: Here's one way, by counting the <li> instances, with the html format: $args = [ 'parent' => 0, 'hide_empty' ...


2

Paging a list of terms/categories/tags are quite easy, and to achieve that, you need minimal info. Lets look at we need the amount of terms the amount of terms per page get_terms() (Just note, the usage of get_terms() have changed in version 4.5). You can also use get_categories() if you wish, get_categories() is just a wrapper function for get_terms() ...


1

I'm not familiar with WP-PageNavi, but I suspect it assumes to be dealing with posts, so it might easily screw up if you use it on a loop like yours. Perhaps the css might still be helpful in styling your html. Anyway, setting up your own pagination is not that difficult. First, you need to know how many categories there are: $cat_amounts=count($cats); ...


1

thanks to @TheDeadMedic, I found the solution. I used reserved terms, and that's why Wordpress interpreted my inputs as query parameters. so for example with my categorys, I had to change my classes in my form : 'post_category' => array($_POST['cat']), // Usable for custom taxonomies too by 'post_category' => array($_POST['my_cat']), // ...



Only top voted, non community-wiki answers of a minimum length are eligible