Tag Info

New answers tagged

0

function my_custom_post_work() { $labels = array( 'name' => _x( 'Store', 'post type general name' ), 'singular_name' => _x( 'Store', 'post type singular name' ), 'add_new' => _x( 'Add New', 'Store' ), 'add_new_item' => __( 'Add New Store' ), 'edit_item' => __( 'Edit ...


0

For a recent project, I had to do this. Here is the code I used to gather the custom post type categories: $profession_terms = get_terms( 'professions', array( 'orderby' => 'count', 'order' => 'DESC', 'hide_empty' => 0 ) ); foreach( $profession_terms as $term ) { $term_link = get_term_link( $term ); ... do other stuff } Assuming ...


1

There is not a file for this. get_terms( $taxonomies, $args ) So you will need to create your own template then select it from the list of templates in a page in.


0

At first you have to catch visitors location. There are many plugins to catch visitors location such as "WassUp Real Time Analytics" Also you have to create post custom fields for location. Then you have to create a filter system in homepage that will check your post location field. After checking which post will be matched with visitor's location that ...


0

You could try this: class List_Category_Images extends Walker_Category { function start_el( &$output, $category, $depth = 0, $args = array(), $id = 0 ) { $saved_data = get_tax_meta( $category->term_id, 'image_field_id', true ); $cat_name = apply_filters( 'list_cats', esc_attr( $category->name ), ...


1

You could schedule a function to be called using a cron job. http://codex.wordpress.org/Function_Reference/wp_cron When you're done, you could probably unregister the cron job from inside the function so it isn't called repeatedly.


1

You're already on the right way; just add another loop for the $parent_terms array around your existing loop. Also it might be a good idea to check if the numbers in the array are valid term IDs, so you might end up doing something like this: $parent_terms = array( 1, 2, 3, 10 ); $taxonomy = 'products'; echo '<ul>'; foreach ( $parent_terms as ...


0

I guess your custom user role does not have the required capability to assign terms, which in case of the post_tag taxonomy would be edit_post. So one thing to do would be giving it to your role—which is most likely not what you would like to do as this does not only affect assigning terms but also a number of other actions). Another thing you could ...


0

Maybe you should use following statement to get categories of a taxonomy: $taxonomy = 'your-taxonomy-name'; $tax_terms = get_terms($taxonomy, array('hide_empty' => false));


0

I get the query error message. What exactly is the error? Are you using a pre_get_posts filter? Something like: function video_query_post_type($query) { if(is_category() || is_tag()) { $post_type = get_query_var('post_type'); if($post_type) $post_type = $post_type; else $post_type = array('post','video'); ...



Top 50 recent answers are included