Articles of categories

How to let the user create a selection of categories via the backend

Consider this: I’ve got a custom post type ‘portfolio’ these posts, or “portfolio items” all have several categories such as: “photography”, “concepting”, “branding” , “clientA” , “clientB” etc. Now I want to build a custom backend sollution to let the user create a pool of “Special categories” which I eventualy want to use to create […]

Is it possible to remove <ul><li> from default category widget?

I´m having some difficulty override to default category widgets in my wordpress theme. I created the theme from scratch. I want to remove the <ul><li></li></ul> from categories in the lists. I want to add my own style using <a href=””></a> instead <div class=”list-group”> <a href=”#” class=”list-group-item”>LifeStyle</a> <a href=”#” class=”list-group-item”>SmartPhones</a> <a href=”#” class=”list-group-item”>Business</a> <a href=”#” class=”list-group-item”>Graphic […]

How to hide category

In my site I’ve does some coding based on the category like in_category(‘featured’) do something. Now, this is only applicable to posts only. Also the posts which is associated with featured category is also associated with other category too. As it is only associated with featured category to show up with special design thats it. […]

Get the child category ID of current category

I am trying to get the category ID of the child (no grand children) of the current category. Using below method: $category = get_category(get_query_var( ‘cat’ )); // get category ID $catid = $category->cat_ID; I can get the current category ID. However, using this in WP_Query result in displaying the posts that are published in Parent, […]

Order Taxonomy Term by date created

Trying to get the order of my custom query to display by Date created. Is this even possible with this query? Can you do a custom order? thanks for the help <?php $faq_cat_terms = get_terms( ‘faq-cat’ ); foreach ( $faq_cat_terms as $faq_cat ) { $faq_cat_query = new WP_Query( array( ‘orderby’ => ‘date’, ‘post_type’ => ‘faq’, […]

WP Dropdown Categories, display subcategories but not grandchildren categories?

So my main goal is to create 3 drop-down category options to run a search. It’s for a car website, so I have 3 parents, “Make”, “Model”, and “Year” At the moment I have the following code <?php $args = array(‘show_option_none’ => ‘Make’, child_of => 5,hide_empty => ‘0’,exclude => ‘0’); ?> <b>Make </b><?php wp_dropdown_categories($args); ?> […]

How to use wp_list_categories with plugin category?

Attempting to use: <?php wp_list_categories( $args ); ?> And this works fine to display a list of the default WordPress category group used for posts(?) but I’m looking to pull a category group that is created by a plugin. Is there a parameter I can pass above that will pull a different group or can […]

How to get posts by category and by choosing a taxonomy term?

I’m new to WordPress and I’ve managed to build most of a full custom theme for wordpress on my own. But the tricky stuff is starting to show its tail, and I’ve spent the last days stuck on Taxonomies. I just managed to put a code for registering a custom Taxonomy to sort my articles […]

Remove Categories and Tags from Admin Dashboard

I’m using my own taxonomy for blog posts and would like to remove Categories and Tags from the Dashboard. I’ve removed them from the Admin Menu and the meta boxes on the Edit Posts page from this question here: Remove Categories / Tags From Admin Menu But now I’m trying to remove it from the […]

Using if statement in index.php instead of creating separate template files

I’ve to add just a line when the user clicks on a category link or search for something, so I thought to do something like this inside the index.php instead of creating other template file like search.php and category.php: <?php if(is_search()): ?> <h1><?php the_search_query(); ?></h1> <?php endif; ?> <?php if(is_category()): ?> <h1><?php single_cat_title(); ?></h1> <?php […]