The site address has been set to https://. The problem doesnt occur if I set the address in General to use http://.
After some digging I can confirm that this only occurs when you have the following setting for your permalink structure:
/%category%/%postname%/
The problem only exists when the permalink contains ‘%category%’.
Does anybody else have a problem accessing the single forum page when using ‘
/%category%/%postname%/’ as your permalink or is it just me?
I dont know why but the first line is missing in the above code?
$querystr = "
Solved!
SELECT * FROM $wpdb->posts
LEFT JOIN $wpdb->postmeta ON($wpdb->posts.ID = $wpdb->postmeta.post_id)
LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID = $wpdb->term_relationships.object_id)
WHERE $wpdb->posts.post_type = 'forum'
AND $wpdb->posts.post_status = 'publish'
AND $wpdb->postmeta.meta_key = '_bbp_topic_count'
ORDER BY $wpdb->postmeta.meta_value DESC
LIMIT 100
";
$forum_posts = $wpdb->get_results($querystr, OBJECT);
if ($forum_posts)
{
global $post;
foreach ($forum_posts as $post)
{
setup_postdata($post);
bbp_forum_title();
the_content();
}