Problem with multi checkboxes value in metabox?
Problem with multi checkboxes value in metabox?
Problem with multi checkboxes value in metabox?
Display all posts from specific category and CPT
That would be achieved using the wp_set_post_terms function. https://codex.wordpress.org/Function_Reference/wp_set_post_terms You could run an ajax request on the change event of the dropdown to either wp-admin/admin-ajax.php or a custom JSON API endpoint (preferred but more work) with a payload like this { new_status: 123 post_id: 321 } Ensure 100% that the user that is logged in … Read more
Have you tried passing an array of values to the value argument? $your_terms = array( ‘foo’, ‘bar’, ‘baz’ ); $args[‘meta_query’] = array( ‘relation’ => ‘OR’, array( ‘key’ => ‘customfields’, ‘value’ => $your_terms, ‘compare’ => ‘REGEXP’ ) ); $this_query = new WP_Query( $args );
You can get the taxonomies that are registered for a post type with get_object_taxonomies(). If you pass the post object directly, you don’t even need to explicitly name the post type either. You can then loop through the result of that function to achieve the result you want: $taxonomies = get_object_taxonomies( $post ); foreach ( … Read more
You need to update below line at where you have register a custom post type using register_post_type function. ‘rewrite’ => array(‘slug’ => ‘teachers/%cat%’) To change permalink dynamically of post type you have to add below code in functions.php file : function change_link( $post_link, $id = 0 ) { $post = get_post( $id ); if ( … Read more
There’s no such page in WordPress. /issues/ doesn’t exist. All WordPress URLs display either a single post/page, or a list of posts/pages (search, date archives, category archives etc.). So there’s no way WordPress will list terms. If you create a new issue, then that will be accessible at /issues/issue-name/, but nothing will exist on /issues/ … Read more
The problem is caused by flush_rewrite_rules(). Remove that line and the issue should be resolved. If you call that function on every page load it can cause issues like this with permalinks. This function should only be run once after your theme or plugin is activated (but not on the activation hook, since that’s too … Read more
I found a way to add html above the post type table which is generated by WP. add_filter( ‘views_edit-my_cpt’, “custom_list_table”); function custom_list_table( $views ) { /* Print form */ ?> <form method=”post” action=”//your.url/?action=action”> <? wp_nonce_field( ‘action-form’, ‘action_nonce’ ); ?> <label for=”field1″><? _e(‘your label’) ?></label><br /> <input id=”field1″ type=”text” name=”field1″><input type=”submit” name=”submit” id=”submitbtn” class=”button button-primary” value=”<? … Read more
As far as I’m aware, your question has been answered here. You’re getting the singular_name correctly, all you need to do is echo it. <?php $taxonomies = get_object_taxonomies( $post ); foreach ( $taxonomies as $taxonomy ) { $term_name = $taxonomy->labels->singular_name; echo $term_name; the_terms( $post->ID, $taxonomy, ‘<span class=”e-article__category__item”><strong>’ . $term_name . ‘: </strong> ‘, “, “, … Read more