Using my own user table

$wpdb is a global variable for the database class. In it $wpdb->users points to the name of the users table. As long as it’s the same database, you can use this to change the name of the table but it might create errors if the schema doesn’t match. Another way is to extend the wpdb … Read more

Loading bbPress CSS file only on forum directory

The styles are enqueued in the function enqueue_styles() inside the file /wp-content/plugins/bbpress/templates/default/bbpress-functions.php. It’s a matter of using is_bbpress() and wp_dequeue_style. Only one of the styles is enqueued, but here we’re removing all 3 possibilities. add_action( ‘wp_enqueue_scripts’, ‘bbpress_enqueue_wpse_87081’, 15 ); function bbpress_enqueue_wpse_87081() { // Check if bbpress exists if( !function_exists( ‘is_bbpress’ ) ) return; if( !is_bbpress() … Read more

pre_get_posts and BBPress in Swagger Theme

I’m not 100% clear on what the problem is, but I would start with putting the conditions inside the function instead of wrapping the entire function. add_filter(‘pre_get_posts’, ‘query_post_type’); function query_post_type($query) { if (!is_admin()){ global $oswcPostTypes; if(empty( get_query_var(‘suppress_filters’ ) ) { $post_type = get_query_var(‘post_type’); //get theme options global $oswc_reviews; if($post_type ) { $post_type = $post_type; set_query_var(‘post_type’,$post_type); … Read more

WordPress -> If Is Role Subscriber Show Image?

This <?php if ( current_user_can(‘contributor’) ) : ?> only checks the users capabilities and is used like this <?php if ( current_user_can(‘edit_post’) ) : ?> You could write a function like this in functions.php: function user_role_check( $role, $user_id = null ) { $user = wp_get_current_user(); if ( empty( $user ) ) return false; return in_array( … Read more

How to add description over forum list on bbpress root page

One possibility would be to hook into the bbp_template_before_forums_index like this: add_action( ‘bbp_template_before_forums_index’, ‘wpse118937_bbpress_forum_list_desc’); function wpse118937_bbpress_forum_list_desc() { //add your description code here } This will be displayed after the breadcrumbs and before the list. If you want more extensive customizations you can customize the template for that, but you shouldn’t do that in the plugin … Read more

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