Tag Info

Hot answers tagged

3

You can use get_the_terms(). I've adapted the following from an example on that page: $terms = get_the_terms( $post->ID, 'visits' ); if ( $terms && ! is_wp_error( $terms ) ) : $visits_name = array(); foreach ( $terms as $term ) { $visits_name[] = $term->name; } $terms_list = join( ", ", $visits_name ); echo ...


2

This: if (is_tag()){ will be true for any query on a tag archive page, including the query WordPress makes to load menu items. You want to check if the current query is both the main query and tag query: if ($query->is_main_query() && $query->is_tag()){


2

Use get_the_tags instead of the_tags to grab an array of tags, and array_chunk to split it. You will then need to build a loop to display the tags. $tags = get_the_tags(); if (!empty($tags)) { $tags = array_chunk($tags,ceil(count($tags)/2),true); foreach($tags as $v) { echo '<ul>'; foreach ($v as $tag) { echo '<li><a ...


2

Avoid serialized whenever you can. It is slow to read and you cannot really search for it. Use custom tables – more than one: One for the relationship between users, tags and images: user_id, tag_id and image_id. One for tag meta data, your attributes, if I understand that right: tag_id, meta_1, meta_2 … Now you can look up for each attachment ID if ...


1

We can override the Ajax call to wp_ajax_get_tagcloud() and do a clean hack. <?php /* Plugin Name: Custom Admin Tag Cloud */ add_action( 'wp_ajax_get-tagcloud', 'ajax_tag_cloud_wpse_99497', 1 ); function ajax_tag_cloud_wpse_99497() { // PASTE ALL THE MODIFIED FUNCTION HERE // ...


1

Without recommending a plugin, I would suggest looking at a service like IFTTT which allows you to chain API's together. From the website: IFTTT is a service that lets you create powerful connections with one simple statement 'if this then that'. Channels are the basic building blocks of IFTTT. Each Channel has its own Triggers and Actions. ...


1

Rather than using a custom table or post meta to store the tag information you will probably find a simpler solution if you investigate the Custom Taxonomy support within WordPress. You can register one (or more) custom taxonomies against the attachment post type. The following Codex pages are a good place to start: ...



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