Custom Taxonomy Endpoint Pagination using paginate_links()
Custom Taxonomy Endpoint Pagination using paginate_links()
Custom Taxonomy Endpoint Pagination using paginate_links()
Hope this can solve your problem function my_custom_post_type() { $labels = array( ‘name’ => _x(‘Projects’, ‘post type general name’), ‘singular_name’ => _x(‘Project’, ‘post type singular name’), ‘add_new’ => _x(‘Add New’, ‘project item’), ‘add_new_item’ => __(‘Add New Project’), ‘edit_item’ => __(‘Edit Project’), ‘new_item’ => __(‘New Project’), ‘view_item’ => __(‘View Project’), ‘search_items’ => __(‘Search Projects’), ‘not_found’ => … Read more
This code works for me. It uses ‘locations’ custom taxonomy and ‘suggest’ javascript. You need to extend it to support multiple term selection. Add custom field to user-edit screen and store metadata when user/admin updates profile // for account owner add_action(‘show_user_profile’, ‘add_custom_user_profile_fields’); add_action(‘personal_options_update’, ‘save_custom_user_profile_fields’); // for admins add_action(‘edit_user_profile’, ‘add_custom_user_profile_fields’); add_action(‘edit_user_profile_update’, ‘save_custom_user_profile_fields’); function add_custom_user_profile_fields($user) { printf( … Read more
This question has different answers in this specific WordPress question, they may be of help: Display all posts in a custom post type, grouped by a custom taxonomy Personally I used this method that worked for me just fine: $terms = get_terms(‘tax_name’); $posts = array(); foreach ( $terms as $term ) { $posts[$term->name] = get_posts(array( … Read more
I wouldn’t recommend using a taxonomy slug that coincides with the public query variables, like title. The title query variable was introduced in 4.4 so I think that could explain your problems. Check out this part of the WP_Query class: if ( ” !== $q[‘title’] ) { $where .= $wpdb->prepare( ” AND $wpdb->posts.post_title = %s”, … Read more
Here’s how I recently added a custom taxonomy to the media library as a sortable column: // Add a new column add_filter(‘manage_media_columns’, ‘add_topic_column’); function add_topic_column($posts_columns) { $posts_columns[‘att_topic’] = _x(‘Topic’, ‘column name’); return $posts_columns; } // Register the column as sortable function topic_column_register_sortable( $columns ) { $columns[‘att_topic’] = ‘att_topic’; return $columns; } add_filter( ‘manage_upload_sortable_columns’, ‘topic_column_register_sortable’ ); … Read more
Here is the fixed version of your code. class vsetup { function __construct() { register_activation_hook(__FILE__,array($this,’activate’)); add_action( ‘init’, array( $this, ‘create_taxonomies’ ) ); } function activate() { $this->create_taxonomies(); wp_insert_term(‘Action’,’genre’); wp_insert_term(‘Adventure’,’genre’); } function create_taxonomies() { $genre_args = array( ‘hierarchical’ => true, ‘labels’ => array( ‘name’=> _x(‘Genres’, ‘taxonomy general name’ ), ‘singular_name’ => _x(‘Genre’, ‘taxonomy singular name’), ‘search_items’ … Read more
Just wrote the function. It’ll display the tinymce editor in every custom taxonomy description right now. Surely you can edit to show it for only some specific taxonomy. /** * Display advanced TinyMCE editor in taxonomy page */ function wpse_7156_enqueue_category() { global $pagenow, $current_screen; if( $pagenow == ‘edit-tags.php’ ) { require_once(ABSPATH . ‘wp-admin/includes/post.php’); require_once(ABSPATH . … Read more
To generalize this is issue of retrieving all terms of taxonomy A that posts with specific term of taxonomy B have. While this is not impossible in several steps and plenty of looping through posts (which will indeed be inefficient), I think it’s reasonable to go through SQL for efficiency. My rough take on it … Read more
When I do this, I get the desired result from this page, but all of my other page links break (using permalinks.) Because, quite simply, WordPress hasn’t got a clue you’re asking for a page. It’s doing what you told it to do; For all URLs that look like http://example.com/X, look for posts with messagetype’s … Read more