Use same wordpress category base and tags as the prefix as the post permalink
Use same wordpress category base and tags as the prefix as the post permalink
Use same wordpress category base and tags as the prefix as the post permalink
Sort Category Archive pages and place sticky posts first
How to get specific number of category post on a page or category page?
I don’t know if your issue is cached values at all, but get_category() does cache results, so it’s a possibility. Here are some other options: $current_cat_id = get_query_var(‘cat’); $category = get_category($current_cat_id); // One possibility: $count_a = get_category_count( $category->slug ); // OR… another possibility: $count_b = wp_count_terms( $category->slug );
If you know the taxonomy slug of it you can use code below: $tax_slug = ‘product_cat’; $cpt_terms = get_term( $tax_slug ); echo ‘<pre>’; print_r( $terms ); echo ‘</pre>’; but if you don’t know the slug, you can use these method: First click on the taxonomy you want to see its terms. In the URL bar … Read more
As you said, you’ve a category (parent one) named as Oregon and its sub-category ‘Southern’, therefore, Oregon / Southern is the correct output. It seems others are in wrong order. If Oregon is parent for Willamette Valley and Central then the result should be: Oregon / Central Oregon / Willamette Valley Consider what hierarchy you … Read more
how do I exclude a category foreach
The default language selector is pretty crap TBH. I created this function using jQuery, you will have to amend to fit your template. function language_selector(){ $languages = icl_get_languages(‘skip_missing=0&orderby=code’); $current_lang = ICL_LANGUAGE_CODE; if(!empty($languages)) { ?> <div id=”language_list”> <div class=”current”> <img src=”https://wordpress.stackexchange.com/questions/95978/<?php bloginfo(“url’); ?>/wp-content/plugins/sitepress-multilingual-cms/res/flags/<?php echo ICL_LANGUAGE_CODE; ?>.png” alt=”<?php echo ICL_LANGUAGE_NAME; ?>” /> <?php echo ICL_LANGUAGE_NAME; ?> <i … Read more
Using query_posts is pretty much always a bad idea as it causes another database query but it also will break pagination and can cause other issues as well. What you need it a filter on pre_get_posts. function pgp($qry) { if (!is_admin() && is_main_query() && $qry->is_category(3709)) { $qry->set(‘orderby’,’meta_value’); $qry->set(‘meta_key’,’Deadline’); //formatted YYYYMMDD $qry->set(‘ignore_sticky_posts’,true); } return $qry; } … Read more
You can simply loop over the categories that you don’t need. get_the_category() return an array of categories that the post belongs to. With that in mind, you can do the following: (Just remember to change 21 and 41 to your desired ID’s) $categories = get_the_category(); foreach ( $categories as $category ) { if( 21 === … Read more