Tag Info

New answers tagged

1

The simple and quickest solution is showing categories list by using sitemap plugin with short-code. For example this plugin WP Sitemap Page. Install it and place shortcode on page. Second option is create page template for category list. Using wp_list_categories() Thanks


1

To get a list of categories when you visit yoursite.com/topics or even the default yoursite.com/categories (doesn't matter; it's not a link structure related issue) you have to have a template for this. It's like a sitemap. If you want to show a sitemap on your front-end, you'll have to have a sitemap template. In this case, it's a category archive what ...


0

You can use the Advanced Custom Fields plugin to add a custom field (an image field) to your custom taxonomy group.


1

I'm not completely sure that you do actually need get_terms() twice. It looks very ineffecient and overboard. I don't know if you need this for ordering purposes, but still, there are better ways of doing this without hitting the db so hard. One alternative is to make one call to get_terms() and then use usort() to sort your terms by parent. But this is ...


1

The second parameter to wp_set_object_terms() takes an array, integer, or string. (array/int/string) (required) The slug or id of the term (such as category or tag IDs), will replace all existing related terms in this taxonomy. To clear or remove all terms from an object, pass an empty string or NULL. Integers are interpreted as tag IDs. ...


2

Implode turns your array like this array( 'Audi', 'BMW', 'Mercedes-Benz' ) into a string separated by the delimiter set in the first parameter of the function, in this case , a comma and a space. In a way you can turn an array into a CSV from this. The result is this: Audi, BMW, Mercedes-Benz. The way WordPress works, it looks for an existing term (within ...


0

Ok, the problem was with my radio buttons. <?php foreach( $regions as $region ) : ?> <label><input type="radio" name="region" value="<?php echo $region->slug;?>" /><span><?php echo $region->name;?></span></input></label><br /> <?php endforeach;?> I have solved this problem by giving ...


0

get_next_post ( ) and get_previous_post ( ) helped in getting what I was looking for. Thanx all for your time


0

Just wanted to share a link that helps explain comments contained in the answer: http://solislab.com/blog/5-tips-for-using-ajax-in-wordpress/ Here's tip 1 mentioned in one of the comments: USE WP_LOCALIZE_SCRIPT() TO DECLARE JAVASCRIPT GLOBAL VARIABLES Although wp_localize_script() is created for localization, it also has another great use. You can ...


2

No way to do that in a "word press" way... function multisite_profession_select(){ switch_to_blog(1); $taxonomies = array('rsitecat'); $check_later = array(); global $wp_taxonomies; foreach($taxonomies as $taxonomy){ if (isset($wp_taxonomies[$taxonomy])){ $check_later[$taxonomy] = false; } else { ...


0

Ok, I did it another way. First, get all the terms for the taxonomy. If the term is equal to the value requested, put it into an array Then do the tax_query with this array. Final $argsc = array( 'order' => 'ASC', 'hide_empty' => true, 'fields' => 'all', ); $termsc = get_terms("cities", $argsc); $cities_array = ...



Top 50 recent answers are included