Search Results for 'test'
-
Search Results
-
Topic: Newby a little lost
I’m working on a test wordpress site for a car club and I’ve tried to add a Forum…
http://thesaabenthusiasts.co.uk/Forum/forum/forum/
Is there anyway of showing the Forum (and it’s topics) on the Forum page, rather than having to click on ‘Forum’ in the Menu, then click on Forum again?
In the main forum i have the configuration for see the latest post. I can change the configuration for show the latest comments?
Topic: Text Justify
I am using the latest version of WP and bbPress. While writing in a topic how can you add colors to text and align the text? I did not see them while editing.
Thank you.I spent so long trawling google for an answer to this question, so i am sharing what i came up with. It might not be beautiful code (i patched it together from a number of sources), but it works for me.
Basically, i have a list of forums on my forum home page. I just wanted to show the latest post within each forum as a teaser below the forum description – not just the title, but the excerpt, too. I can’t believe there’s nothing out there explaining how to do this. It seems like a pretty obvious format for the forum index.
The following snippet will output the latest reply, with post title and post link below the forum description. If there are no replies, it will output the latest topic instead.
function jag_add_last_reply() { { $jag_last_reply_id = bbp_get_forum_last_reply_id(); $jag_last_topic_id = bbp_get_forum_last_topic_id(); $new_args = array( 'post_type'=> 'reply', 'p' => $jag_last_reply_id ); $other_args = array( 'post_type'=> 'topic', 'p' => $jag_last_topic_id ); $nest_query = new WP_Query( $new_args ); $another_nest_query = new WP_Query( $other_args ); if ( $nest_query->have_posts() ) : while ( $nest_query->have_posts() ) : $nest_query->the_post(); $this_post_id=$post->ID; $this_post_title= get_the_title(); $this_post_content= get_the_excerpt(); $this_post_permalink= get_permalink(); ?> <a href="<?php echo $this_post_permalink; ?>"><h1><?php echo $this_post_title; ?></h1></a> <div class="the_content"><?php echo $this_post_content; ?></div> <?php endwhile; elseif ( $another_nest_query->have_posts() ) : while ( $another_nest_query->have_posts() ) : $another_nest_query->the_post(); $this_post_id=$post->ID; $this_post_title= get_the_title(); $this_post_content= get_the_content(); $this_post_permalink= get_permalink(); ?> <a href="<?php echo $this_post_permalink; ?>"><h1><?php echo $this_post_title; ?></h1></a> <div class="the_content"><?php echo $this_post_content; ?></div> <?php endwhile; endif; }} // Hook into action add_action('bbp_theme_after_forum_description','jag_add_last_reply');Just put this in your theme’s functions.php and it should do the trick. Haven’t figured out how to spit out multiple posts and replies for each forum yet, but this is all i needed. Good luck.


