Tag Info

Hot answers tagged

6

Normally to add fields to quick edit field, we should use 'quick_edit_custom_box' action hook that is triggered only for custom colums, because core colums are explicitly exluded (see code). If we add a custom column, then it will be shown in the list table, but it doesn't make sense, because the column description is already present. However we have the ...


2

Probably you're making a wrong use of taxonomies. Instead of using only the Categories taxonomy, you should create several Custom Taxonomies. I mean Blog Categories, Download Categories, Team Departments, etc... should be different taxonomies, and you should assing each of these taxonomies to the custom post type(s) they're related to... Check the function ...


2

You are using wrong number of arguments in add_filter, you specified to get 2 arguments and you are looking for third one: Update your add_filter code to this: add_filter( 'manage_post_tag_custom_column' , 'my_custom_column' , 10 , 3 ); The 3 in the end tells the filter to provide all the three arguments to your function.


2

Edit If this is your goal: I want to use the Wordpress gallery to show all pictures of one category in a gallery (on a fixed page), which I do not have to update all the time by inserting the pictures manually. Then the easiest way to accomplish it is via custom page template. Create the template Copy your page.php template file, and name it ...


1

Please try the following: add_action( 'pre_get_posts', function( $query) { if( is_tax( 'TAXONOMY NAME') && isset( $query->tax_query->queries[0]['include_children'] ) ) $query->tax_query->queries[0]['include_children'] = 0; });


1

Totally untested and I'm not 100% sure I understand your question, but this should (in theory) get 5 posts that share any of the same venues as the current post. I would probably suggest adding some Transients to this so that you aren't constantly running queries. If it doesn't work, I suspect the syntax of my tax query is a little off. It always gets me ...


1

Looking at your comment, photos and videos aren't custom post types but actually categories. I'm changing my answer to reflect your comment. You can use WP_Query to exclude specific categories in your loop. You can achieve that with $query = new WP_Query( 'cat=-1,-2,-3' ); This will exclude categories with ID's 1, 2 and 3, and will only show categories ...


1

Per the Codex: relation (string) - The logical relationship between each inner taxonomy array when there is more than one. Possible values are 'AND', 'OR'. Do not use with a single inner taxonomy array. So you are on the right track, but your tax_query is wrong. relation is part of the outer tax_query array and not part of the top level query ...



Only top voted, non community-wiki answers of a minimum length are eligible