WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Media Tags
Display all tags of an image (8 posts)

  1. Philipp Speck
    Member
    Plugin Author

    Posted 1 year ago #

    @deepbevel: You could do sth. like this:

    $term_list = wp_get_post_terms(19, 'media_tag', array("fields" => "all"));
    print_r($term_list);

    http://wordpress.org/extend/plugins/wordpress-media-tags/

  2. Philipp Speck
    Member
    Plugin Author

    Posted 1 year ago #

    where 19 is the $post_id

  3. deepbevel
    Member
    Posted 1 year ago #

    thanks, does it need a post id?

    I'd better review how the plugin works, haven't tried it yet but I intend to.

    I was using something similar but couldn't get dynamic output in the templats, had to use get_posts with tag conditionals. Everytime I wanted to output a new tag, I had to add it's tag as a condition in the template. Not so good.

    maybe this plugin has a way?

  4. Philipp Speck
    Member
    Plugin Author

    Posted 1 year ago #

    You can do all those things which you can do with normal posts and their assigned tags, too. Technically they are eaqually.

  5. deepbevel
    Member
    Posted 1 year ago #

    Yes, but there's something I'm missing in my understanding of dynamic tags and category links, as related to a plugin like this.

    the_category and the_tags get all posts in the category/tag of the current post, or current achive, without specifying post id or the category.

    the goal is for a user to create a media category, then have attachments in that cateogory appear in an acrchive page list, without adding code for each new category or tag

    is this not possible with media tags?

  6. Philipp Speck
    Member
    Plugin Author

    Posted 1 year ago #

    If you want to show up all tags assigned to an image replace line 105 in my plugin with:

    $tags = get_the_term_list( $post->ID, 'media_tag', '', ', ', '' );
    $output .= '<a title="'.get_the_title().'" href="'.$url.'">'.$image.'</a>'.$tags."\n";

    This is just an idea how to get what you want!

  7. Philipp Speck
    Member
    Plugin Author

    Posted 1 year ago #

    Without changing my plugin (WordPress Media Tags 1.5) you can always retrieve the tags on the attachment page (image.php) by adding the following in you template:

    <?php print get_the_term_list( $post->ID, 'media_tag', '<p>Tags: ', ', ', '</p>' ) ?>

  8. deepbevel
    Member
    Posted 1 year ago #

    thank you, anxious to try.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.