WordPress.org

Ready to get started?Download WordPress

Forums

Related Posts by Taxonomy
[resolved] Filter by a single tag? (7 posts)

  1. dpeschio
    Member
    Posted 5 months ago #

    Great plugin. Thank you for building it! This gets me 98% there. A single post on my site may have a number of related tags, but I need to display posts from just one. Below is the shotcode I'm using. Can I Ifilter by a single tag?

    [related_posts_by_tax taxonomies="post_tag" format="thumbnails" posts_per_page="6"]

    https://wordpress.org/plugins/related-posts-by-taxonomy/

  2. dpeschio
    Member
    Posted 5 months ago #

  3. keesiemeijer
    moderator
    Plugin Author

    Posted 5 months ago #

    Try it with this:
    http://wordpress.org/support/topic/filter-by-tag-2?replies=3&view=all

    If you're only using the shortcode and one tag ID to get the related posts for it would be better to just add a filter to the gallery shortcode and use that:
    http://codex.wordpress.org/Gallery_Shortcode

  4. keesiemeijer
    moderator
    Plugin Author

    Posted 5 months ago #

    Here is what a filter in your theme's functions.php file would look like: http://pastebin.com/xGTZ8tj8

    With this you can use the gallery shortcode like this:

    [gallery tag_id="93"]

    or this:

    [gallery tag_id="93" size="medium" posts_per_page="4"]
  5. dpeschio
    Member
    Posted 5 months ago #

    Thanks for the quick response. Unless I am misreading the codex, the gallery shortcode will not work.

    The page I have linked as an example is for a specific brewery. It's tagged with the brewery name, its location, and a general category. What I want to show in related posts are all other posts tagged with the brewery name - in this case Catawaba.

    Its sounds like filtering to this level is not possible with your plugin?

  6. keesiemeijer
    moderator
    Plugin Author

    Posted 5 months ago #

    I've tested the filter for the gallery shortcode and it works, but the thumbnails link to the attachment file instead of the related post. That's no good.

    Have you tried the code from the other forum topic?

    Its sounds like filtering to this level is not possible with your plugin?

    That's correct. It can't do this out of the box. Do you need to filter by a different tag for other posts as well? Or are you using the plugin just for this post?

  7. dpeschio
    Member
    Posted 5 months ago #

    I will need to filter by many different tags. I am investigating building a custom post type that will display related posts by tag. That may be the answer. I'll let you know at the end of the day.

Reply

You must log in to post.

About this Plugin

About this Topic