How to get bbpress sticky topics

You can make the query like above using following code. <?php query_posts( array( ‘posts_per_page’ => 2, ‘meta_key’ => ‘_bbp_sticky_topics’, ‘post_type’=> ‘topic’, ‘order’ => ‘ASC’ ) ); if (have_posts()) : while (have_posts()) : the_post(); //do something endwhile; endif; ?> But i strongly recommend you not to alter main query using query_posts() and instead use WP_Query as … Read more

How to display BBpress statistics?

It seems BBPress got a function called bbp_get_statistics() read source. You can throw an array of $args = array(); in it. You also have a filter to modify the output: apply_filters( ‘bbp_get_statistics’, $statistics, $args ); Disclaimer: I’m no BBPress expert – I haven’t even installed it somewhere, just found this via google.

How to disallow participant from publishing topics(bbpress)?

OK I got a quick Solution. I enable the plugin BBpress Moderation and change the following code in /wp-content/plugins/bbpressmoderation/bbpressmoderation.php FROM: /** * Before inserting a new topic/reply mark * this as ‘pending’ depending on settings * * @param array $data – new topic/reply data */ function pre_insert($data) { global $wpdb; if (@$data[‘post_status’]==’spam’) return $data; // … Read more

bbPress replies list

bbPress doesn’t have archive for replies implemented. It does have topics archives – www.siteurl.com/topics/ and will list all topics. But, for replies, it doesn’t have anything that is needed to display replies list, and it needs rewrite rules, code to handle the archives and render it. The only way to do it is to implement … Read more

How to add more fields to bbPress registration form

This is completely untested as I don’t use bbPress or have a copy on hand to try out for myself, but this page seems to have some code that allows you to add new registration fields. <?php /* Plugin Name: Customize User Profile */ add_filter( ‘get_profile_info_keys’, ‘customize_user_profile’, 10, 2 ); function customize_user_profile( $fields, $context ) … Read more

Conditional if statement ($post->ID == get_the_ID) not working

The expression will always be true. Take a look at get_the_ID(); function get_the_ID() { global $post; return $post->ID; } So your code is effectively running as; if ( $post->ID == $post->ID ) // always true! Instead, cache the ID of the main post in a variable, then compare that instead. <?php global $post; /** * … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)