Title: Shortcode attribute from one post
Last modified: August 21, 2016

---

# Shortcode attribute from one post

 *  Resolved [yox64](https://wordpress.org/support/users/yox64/)
 * (@yox64)
 * [13 years ago](https://wordpress.org/support/topic/shortcode-attribute-from-one-post/)
 * Hi there!
 * I have a plugin that creates a shortcode [groups tags=”tag-name”], that gets 
   the tags attribute and shows all the posts with those tags.
 * The problem is that if I have two posts with two different shortcode attributes(
   post1: [groups tags=”Actors”], post2: [groups tags=”Singers”] ), when I go to
   one of those posts pages, it shows all the posts with Actors and Singers, when
   it should show only the posts with the shortcode that has the attributes(post1
   should show only posts with actors and post2 should show only posts with singer).
 * So does everyone know how can I fix this?
 * Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years ago](https://wordpress.org/support/topic/shortcode-attribute-from-one-post/#post-3758330)
 * what plugin?
 * where did you download the plugin from?
 * does the plugin have instructions for how to use the attributes?
 * you might need to dig into the plugin’s files to find teh code which creates 
   the post list …
 *  Thread Starter [yox64](https://wordpress.org/support/users/yox64/)
 * (@yox64)
 * [13 years ago](https://wordpress.org/support/topic/shortcode-attribute-from-one-post/#post-3758333)
 * I created my own plugin that creates another post type and enables the usage 
   of this shortcode.
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years ago](https://wordpress.org/support/topic/shortcode-attribute-from-one-post/#post-3758385)
 * > I created my own plugin
 * bingo – then you will know best what code is used to retrieve the posts according
   to the `tags` attribute;
 * you are allowed to use the [_pastebin _](http://pastebin.com/)to share the code(
   see [http://codex.wordpress.org/Forum_Welcome#Posting_Code](http://codex.wordpress.org/Forum_Welcome#Posting_Code))
   so somebody could have a chance to check it.
 *  Thread Starter [yox64](https://wordpress.org/support/users/yox64/)
 * (@yox64)
 * [13 years ago](https://wordpress.org/support/topic/shortcode-attribute-from-one-post/#post-3758393)
 * This ( [http://pastebin.com/Fup7Lw3u](http://pastebin.com/Fup7Lw3u) ) is the 
   code that I used to create the shortcode. It gets all the required information,
   but when I access one of the posts page, it does show me posts with shortcode
   attributes from all posts. I only need shortcodes attributes per post, not all
   of them.
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years ago](https://wordpress.org/support/topic/shortcode-attribute-from-one-post/#post-3758444)
 * review:
 * [http://codex.wordpress.org/Class_Reference/WP_Query#Tag_Parameters](http://codex.wordpress.org/Class_Reference/WP_Query#Tag_Parameters)
 * `'tag_slug__and'` expects an array as parameter, and also _slugs_, i.e. no capital
   letters or spaces
 *  Thread Starter [yox64](https://wordpress.org/support/users/yox64/)
 * (@yox64)
 * [13 years ago](https://wordpress.org/support/topic/shortcode-attribute-from-one-post/#post-3758446)
 * Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Shortcode attribute from one post’ is closed to new replies.

## Tags

 * [attributes](https://wordpress.org/support/topic-tag/attributes/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 6 replies
 * 2 participants
 * Last reply from: [yox64](https://wordpress.org/support/users/yox64/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/shortcode-attribute-from-one-post/#post-3758446)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
