Problem with wp_list_categories
Problem with wp_list_categories
Problem with wp_list_categories
You can create a custom template in the theme and give options for each category to select the template. The custom fields for a category can be added using, ‘Advanced Custom fields’ plugin or you can refer this article. Once you do this, you need to edit the ‘category.php’ file, to set the template for … Read more
This might be because you have created wordpress-plugins twice. Please check your database if it already exists.
I believe what you’re seeing is the expected behavior when parent is set to 0 which is what get_cat_id() returns if it fails to find a category ID for the $cat_name argument. You can quickly test this by putting var_dump($current_cat_id); anytime after you set it to see if this guess is right. If so, you’ll … Read more
Try going to your permalinks page within the admin to flush the rewrite rules. Just be navigating to that page will flush the rules, but you could click save even if you made no changes.
gdaniel, thank you for your reply, but actually I mean different : 1) show missing fields in my post_type listing 2) modify categories block, not to add/delete categories, but always show 2 existing categories, as they are constants for my post_type .
Since you’re not currently running a multi-site install, you can either install the WP-REST-API plugin which is currently in beta, or you can wait for it to hit core which will probably be around version 4.3 or 4.4. If you were on a multi-site install, you could have easily used the switch_to_blog() function to switch … Read more
Display posts that have “all” of these categories: $query = new WP_Query( ‘category_name=staff+news’ ); See this on category parameters.
First query all post $args = array( ‘post_type’ =>’posts’, ‘post_status’ =>’publish’, ‘posts_per_page’ =>-1 ); $query = new WP_Query($args); $post_ids = array(); if($query->have_posts()){ while ($query->have_posts()){ global $post; $query->the_post(); array_push($post_ids,$post->ID); } } Now you have an array called $post_ids which contains all post’s id . Now , change the categories Loop through the array and change the … Read more
Absolutely. Since you can instantiate to a variable a query you can do it as much times as you want. Of course query loops require a lot of connections to the database so you have to be careful. Very often if you need many subqueries it basically means that your workflow can be enhanced in … Read more