Tag Info

New answers tagged

1

I may suggest not combining each of these into hierarchical taxonomies, but setting up 3 distinct taxonomies. It seems like they are 3 unrelated properties of the photos, and thus, I would separate the code for them. Then you're not trying to code around nested taxonomy terms, but you can access them each individually. The taxonomies would be color, location ...


0

i finally figured out a solution. I guess it's not the perfect one, because all posts are still looped and the wrong language just doesn't show, but for now it works. I am still open for ideas. My idea right now is to get the language of the post and don't display it if it doesn't match the pages language. Here's the new part. global $polylang; $postlang ...


1

If you want an example of how to do the dropdown filtering using ajax, then if you factor out your taxonomy dropdown into your "functions.php": function my_dropdown_categories( $taxonomy, $current_selected = '', $include = null ) { // Get all terms of the chosen taxonomy $terms = get_terms($taxonomy, array('orderby' => 'name')); // our ...


0

Use jQuery action on first dropdown .. this is the code from your mentioned url .. You can populate the arrays using php functions ... function dynamic1(parent,child) { var parent_array = new Array(); // This is the default value parent_array[''] = ['Please select a manufacturer']; // All other elements // parent_array['PARENT NAME'] = ...


0

You might want to check out this post, as your post is linked to that question. That should explain most of your question. As for your code, move that outside the the loop. You were nearly there with your code. Check out get_terms in the codex to see which objects you can use that is returned by the function. You can use $term->description instead of ...


2

There is no way easy way to do that. You have to query directly to achieve that. I am assuming, you only want the parent categories which don't have descendants or even if they have descendants, it's not used in any post global $wpdb; $categories = $wpdb->query("SELECT $wpdb->terms.* FROM $wpdb->terms ...


0

wp_list_categories() is an odd function in that it's uniquely useful in certain situations with custom taxonomies but it was originally written before they even existed. (It was introduced in 2.1 and the taxonomy attribute was added in 3.0 (source).) What you're seeing is a known issue with an associated bug report (filed two years ago, last activity four ...


10

Taxonomies, as previously described are a collective noun for the following category post_tag post_format link_category custom taxonomy The first four are built-in taxonomies, while custom taxonomies are taxonomies that are manually created by the user with register_taxonomy. Custom Taxonomies can be hierarchical (like the build-in taxonomy category) or ...


3

Category, Tag, Link Category and Post Formats are built in taxonomies. From Codex Basically, a taxonomy is a way to group things together. The names for the different groupings in a taxonomy are called terms. Using groupings of animals as an example, we might call one group "birds", and another group "fish". "Fish" and "birds" are terms in our ...


2

You can use get_term_by() for this <?php $term_id = array_pop(get_sub_field('sector_selector')); $catinfo = get_term_by( 'id', $term_id, 'name_of_the_taxonomy' ); print $catinfo->slug;


2

I think you've arrived at the structure that WP doesn't quite support. Let's start with following premises: Taxonomies exist for grouping posts. Hierarchical taxonomies can have multiple level of grouping (with larger groups encompassing smaller groups). But what you had drafted is something else — taxonomy grouping another taxonomy. Simply put that's ...


2

There isn't a standard way to do it AFAIK in the form() method; here's a function to do it: function wp158055_get_sidebar_id( $widget ) { foreach ( wp_get_sidebars_widgets() as $sidebar_id => $widget_ids ) { if ( array_search( $widget->id, $widget_ids ) !== false ) return $sidebar_id; } return false; } And call with $this. Note ...


1

No, a term can have many children, but only a single parent. The parent field in the database can hold only a single value. It is a hierarchical one to many relationship, not a many to many relationship. The same is true of posts. A post can have only 1 parent, but many children. To get around that you would use taxonomies. A sidenote on wp_term_taxonomy, ...


0

Try to structure your categories with the tax-meta-class http://en.bainternet.info/wordpress-taxonomies-extra-fields-the-easy-way/. You will be able to add meta fields to your taxonomies (categories, tags, custom tax).


0

Wordpress doesn't have the option to add extra information to taxonomies. There isn't any taxonomy_meta table. So, you have two options. Create a new custom table and save the extra information(image link) there. You can also use options table to store the information. You can follow this post of as it shows how to implement what you are trying to do: ...


0

Finally found the problem. This theme flush the rewrite rules on every request. I have removed the multiple calls to flush_rewrite_rules() and the problem is now gone.


1

This is expected output from what you have in your code. Never change the main query for a custom query on any archive page or on the home page. Custom queries are always troublesome as the main query is quite specific on these pages. I would advice you to rather use pre_get_posts to alter the main query on that specific archive page or home page you want ...


0

Thanks Tomas, Here is solution for someone, who had same problem: $citys = get_the_terms( $post->ID, 'city' ); if ( $citys && ! is_wp_error( $citys ) ) : $city_link = array(); foreach ( $citys as $city ) { $city_link[] = '<a href="city/'.$city->slug.'">' . $city->name . '</a>'; } ...


0

<?php get_the_terms( get_the_ID(), 'city' ); ?> You can learn more about this function here.


1

I would create 2 custom post types: People Organizations I would use the default Post post type for the articles (Assuming you're not already using this for a blog or something else). ACF is my plugin of choice when it comes to custom fields, it allows you to create metaboxes that list all posts under a custom post type. It also allows you to select ...


1

Then I thought I could create a custom post format for each of the non-article content types (people, orgs, events, places) ... This is your best option. Each entity type (person, org, place) will have different attributes so they would fit best in their own post type. Here is a good article on creating them and it suggests using the Custom Post ...


3

Your terminology is a bit scrambled here. A custom taxonomy is a taxonomy which you manually register through register_taxonomy. In your case that is ait-dir-item-category. Any "category" (as you call it) you create in your custom taxonomy is called a term. In this case events. To create a custom page for events, you need to name your template ...



Top 50 recent answers are included