Tagged: ORDER by tag
May 9, 2020 at 3:13 pm #15434ProtagonistaParticipant
We are a media company that are contemplating in migrating our site to GeneratePress and WP Show Posts (we already bought your tools). However, for us it is important that at the end of each article, there are related posts filtered by Tags. We currently have 11637 articles and 555 tags.
We want to create a list for each tag on our site, and then add the shortcode through an element (hook).
That said, at least we will have 555 lists and 555 hooks. Our question is whether this could slow down the site or if there is a more optimal way to do it. Our main intention to use your tools is the performance of the site.
Thank you very much for your help,
DanielMay 12, 2020 at 4:49 pm #15500
I would definitely advise against adding that many lists.
What will the lists do, exactly? Show posts from the same tag as the current post? What if there is more than one tag?
Let me know 🙂August 10, 2020 at 5:37 am #18106
Hi, we need the same thing. I have both theme and PRO plugin. I have created a list which I show below the post. In “more setting” of the list I have no ORDER by TAG. How can I add it? Thank you!August 10, 2020 at 1:53 pm #18132
What will the lists do, exactly? Show posts from the same tag as the current post? What if there is more than one tag?August 10, 2020 at 2:01 pm #18137
Exactly: Show posts from the same tag as the current post (there will only be one tag). In case there are no tags the normal current post per category. Missing a TAG filter would be very handy. 🙏
Thanks for the reply.August 11, 2020 at 4:39 pm #18172
You would need to use the PHP function in a hook:
$tags = get_the_tags(); $tag_slug = $tags->slug; wpsp_display( 123, 'tax_term="' . $tag_slug . '"' );
You just need to hook that into single posts and update
123with the ID of the list.August 13, 2020 at 4:23 am #18222
Thanks for your code.
Ok I added the code, and put ID of the list 731 (see attached photo).
Result: “Sorry, no posts were found.”
But the TAGs are there on more articles.
The taxonomy I have left blank. (see photo). please it is important for news sites.
🙏🙏🙏🙏August 13, 2020 at 10:17 am #18227
Can you try giving the list the proper taxonomy?
If that doesn’t work, try adding
var_dump($tag_slug)after line 6. Does it output anything?August 13, 2020 at 11:13 am #18235
tried, and his answer is
string (0) “”August 13, 2020 at 2:55 pm #18244
Can you try the updated code?: https://wpshowposts.com/support/topic/show-posts-by-tag/#post-18172August 13, 2020 at 3:16 pm #18247
New code applied and added var_dump ($ tag_slug):
He writes to me:
“Sorry, no posts were found.”
“string (5)” other ”
OTHER is the right TAG! Other posts with the same tag are not seen.
Does it work on your wordpress test? Theoretically it should work, the tag is right.August 14, 2020 at 12:22 pm #18275
Did you add the correct taxonomy in the list settings UI?August 14, 2020 at 11:05 pm #18289
Works perfectly, generic TAG taxonomy (without clicking anything).
Thank you very much!
Great assistance!August 16, 2020 at 9:54 am #18323
Glad I could help 🙂August 16, 2020 at 10:27 am #18329
- You must be logged in to reply to this topic.