Info
- 7 posts
- 3 voices
- Started 2 years ago by jdrancor
- Latest reply from PS Vita
- This topic is not resolved
compare WordPress tags to BBpress tags. Relevant posts.
-
- Posted 2 years ago #
Hi, I'm trying to list topics from the forum in a WP post. I'm wanting to just show the topics that have the same tags as the particular post that is being viewed.
This is basically a display relevant posts. How can this be done? I've tried a bunch of PHP, but I'm not having luck navigating the codex between the two databases. I've mucked around alot, but I can't get beyond the basic display the last 10 posts functionality.
Here's where I'm at: HELP?
<?php
global $wpdb;
$query="SELECT * FROM bb_topics WHERE topic_status=0 ORDER BY topic_time DESC LIMIT 10";
$results=$wpdb->get_results($query);foreach ($results as $result) {echo "
- topic_id."'>".$result->topic_title."
";}
?> -
- Posted 2 years ago #
Did you get this work already?
-
- Posted 2 years ago #
anyone?
-
- Posted 2 years ago #
This is fairly simple to do, but you have to define exactly what you want it to do.
i.e. Are you looking for forum topics that include any of the Tags in the blog post? This means that there will be no ordering or weighting on relavancy.
This line of WP code will help you on your way too:
$tags = wp_get_post_tags($post->ID);
-
- Posted 2 years ago #
I want the same as the relevant posts plugin does but also for the forum.
If the blogpost in WP has the same tags as a forum topic i want to show the links on the blogpost with relevant forum posts.
Can this be done?
-
- Posted 2 years ago #
Yes :)
Just remember that users set tags, and users are notoriously useless.
Especially if your forum / blog is not aimed at technical people (who have, to a certain degree, become used to the idea of tags for cross pollination). -
- Posted 2 years ago #
Thnx for your answer KEvin, how can this be done?
-
You must log in to post.