Tag Info

New answers tagged

0

Use 'tags_input' instead of 'post_tags'. See here in the notes: http://codex.wordpress.org/Function_Reference/wp_insert_post You could use wp_set_post_tags() function: http://codex.wordpress.org/Function_Reference/wp_set_post_tags


0

What tags/terms/taxons do you get? The the_tags( $before = null, $sep = ', ', $after = '' ) function is a wrapper for get_the_tag_list( $before = '', $sep = '', $after = '', $id = 0 ). This function applies the filter the_tags on the get_the_term_list( 0, 'post_tag', $before = '', $sep = '', $after = '' ) (0 is the $id and $post_tag the $taxonomy ...


2

As stated in a comment, your get_posts parameters are wrong. There is no such parameter as term_id. You should make use tag which uses the tag slugs as a string or tag__in which uses the tag ids in an array This will work $posts = get_posts('numberposts=6&tag='. $tags->slug); or this will work $posts = get_posts('numberposts=6&tag__in=' . ...


0

Looks like all I needed was to include 'posts_per_page' => -1 in the $query_args array. Final, working code: <ul class="tag-list"> <?php $query_args = array( // Easier to call the parent category, "recipe" instead of dealing with all these ids // 'cat' => '101,94,93,56,72,99,100,63,98,95,96,80,4', ...


0

Found the solution in https://core.trac.wordpress.org/browser/tags/4.0/src/wp-includes/taxonomy.php#L0 wp_add_object_terms() uses wp_cache_delete(), but wp_remove_object_terms() don't. Just added this: wp_remove_object_terms( $post->ID, $tag_id, 'post_tag' ); wp_cache_delete( $object_id, 'post_tag_relationships' );


0

First, search for the function tie_last_posts_cat**. It's probably inside functions/theme-functions.php Then search for $lastPosts = get_posts('category='.$cats.'&numberposts='.$numberOfPosts); Change it to $lastPosts = get_posts('category='.$cats.'&numberposts='.$numberOfPosts.'&orderby=rand'); Hope this helps This might also help


0

Have a try, I din't test. On line 48 change: $categories_obj = get_categories(); with $categories_obj = get_tags(); And also look for the tie_last_posts_cat() function in your code, and modify it accordingly.


0

I'm not sure why you're getting the '0's. But you shouldn't be using 2 switch statements in work_custom_columns(). Try this: function work_custom_columns($column){ global $post; switch ($column){ case "work_category": echo get_the_term_list($post->ID, 'work_category', '', ', ',''); break; ...


0

I realised my mistake. The following line in my functions.php: ~remove_filter('the_content', 'wpautop'); This was in the WordPress underscore empty template which I started the project with, and was removing html from the content.


1

I'm not in the position to code right now, but here is an idea A thousand posts is quite a lot, but it is even more if you are retrieving all posts from the db in one go. What if you have ten thousand posts, of which only ten or twenty is not tagged after the whole retagging operation. This can become such a huge query that you run the danger of timing out ...


-2

<?php $args = array( 'smallest' => 12, 'largest' => 12, 'unit' => 'pt', 'number' => 0, 'format' => 'array', 'separator' => "", 'orderby' => ...


0

For custom taxonomies, I found a solution without writing a save_post hook. When register a taxonomy, need to specify 'meta_box_cb' => 'single_taxonomy_select_meta_box' For more details, please download this gist /** * Meta box to select only one taxonomy value * * @param WP_Post $post * @param array $box */ function ...


0

You can add this to form action: wp_set_post_tags( $post_ID, $tags, $append ) Function reference: wp_set_post_tags


1

Working off the assumption that you're already on Post One, and want to add Post Two below it, as a "Related Posts" type feature, you can use a standard WordPress function to get an array of One's tags, then do a query to grab and display posts with tags that match. //get just the IDs of Post One's tags $tag_ids = wp_get_post_tags($post->ID, ...



Top 50 recent answers are included