WordPress.org

Forums

Posts By Tag
[resolved] use calling posts tags (update-code) (2 posts)

  1. HeliR
    Member
    Posted 2 years ago #

    Hi friend,
    to update your plugin to automatically use the calling-post's tags I have made following changes
    - added mytags in the shortcode_handler - options
    - added "if ($mytags) { .....

    then you get a plugin that automaticalle links with the recent posts from the posts tags, super usable!
    I am using tags to mark my posts, have about 1000 Pages with about 150 different tags, so I can easy concat those posts with the same tags.

    tx a lot for your plugin

    function shortcode_handler($attributes) {
    $options = shortcode_atts(array(
    "tags" => '', // comma Separated list of tags
    "mytags" => TRUE, // es werden meine eigenen Tags genommen
    "number" => 5,
    "exclude" => FALSE,
    "exclude_current_post" => FALSE,
    "excerpt" => FALSE,
    "content" => FALSE,
    'thumbnail' => FALSE,
    'order_by' => 'date',
    'order' => 'desc',
    'author' => FALSE,
    'date' => FALSE,
    'tag_links' => FALSE,
    'link_target' => ''
    ), $attributes);

    $options = pbt_validate_boolean_options($options, $this->boolean_fields);
    $tags = $options['tags'];

    if ($mytags) {

    $posttags = get_the_tags();
    if ($posttags) {
    foreach($posttags as $tag) {
    $test = ',' . $tag->name;
    }
    $tags = $test;
    }
    }

    // call the template function

    http://wordpress.org/extend/plugins/posts-by-tag/

  2. Sudar
    Member
    Plugin Author

    Posted 2 years ago #

    Hello,

    Thanks for the sending in the code. But the feature is already available in the Plugin :)

    If you leave the tags empty, then by default it will pick up the tags from the current post.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Posts By Tag
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.