How to internationalize the sub menu name “categories” in Custom post type?
How to internationalize the sub menu name “categories” in Custom post type?
How to internationalize the sub menu name “categories” in Custom post type?
You can use get_ancestors for this: get_ancestors( $term_id, ‘taxonomy’ ); Of course this will only work on hierarchical elements. Additionally, this will only work reasonably well if only one term per level is assigned, take a look at my comment here and my answer here to get a little bit deeper insight into that.
Custom Post Type Permalinks Problem
you can use esc_attr function save_taxonomy_custom_meta_bandcamp_embed_music( $term_id ) { if ( isset( $_POST[‘term_meta’] ) ) { $t_id = $term_id; $term_meta = get_option( “taxonomy_$t_id” ); $cat_keys = array_keys( $_POST[‘term_meta’] ); foreach ( $cat_keys as $key ) { if ( isset ( $_POST[‘term_meta’][$key] ) ) { $term_meta[$key] = esc_attr( $_POST[‘term_meta’][$key] ); // encoded text with HTML entities … Read more
$args = array( ‘post_type’ => ‘inspirations’, ‘posts_per_page’ => 10 ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); $collections=””; foreach ( (array) wp_get_post_terms( get_the_ID(), ‘collections’) as $collection ) { if ( empty($collection->slug ) ) continue; $collections .= ‘ collection-‘ . sanitize_html_class($collection->slug, $collection->term_id); } echo ‘<div class=”inspirations-post ‘. $collections . ‘”>’; the_title(); … Read more
If I were doing a site such as you describe, I would probably make a Custom Post Type for “Artists”, another Custom Post Type for “Albums”, and would link them with the “Posts 2 Posts” plugin. It’s easy to use and well documented. That way, you can later easily attach images and galleries, mp3s, and … Read more
It should be “categories/category_slug” not “work/category_slug” for the category archieve page
I believe that WPPizza Categories is coming from ‘name’ => _x( ‘WPPizza Categories’, ‘taxonomy general name’ ) And your url problem is coming from not setting a slug. For example: ‘rewrite’ => array( ‘slug’ => ‘pizza_categories’, ‘with_front’ => false ), You need to replace the slug with something else, as you need something in place … Read more
the_tags is only for the post_tag taxonomy, use the_terms to output custom taxonomies with a similar format: the_terms( $post->ID, ‘tagevents’, ‘<span class=”tags-button”>Tags : ‘, ‘ ‘, ‘</span><br />’ );
Run get_terms like this: var_dump(get_terms(‘category’,array(‘hide_empty’=>false))); And then like this: var_dump(get_terms(‘category’)); You should be able to infer what is happening. The first should return the zero based array you expect, with neatly numbered keys. The second does not. The only difference being the hide_empty argument. If you really must have a zero based array just pass … Read more