Creating a “walled garden” of comments

Some suggestions, added as comments: function filter_the_comments( $array ) { $comment_IDs = array(); foreach ( $array as $key => $val ) { //assuming the comments are sorted by date in ascending order, a parent has to come before the child comment, so there is no need to wait till all subsequent IDs have been added … Read more

Change username link in admin bar

Create the following directory and file. wp-content/mu-plugins/admin-bar-tweaks.php Or, you can add this to your theme’s functions.php file. In the script below, remember to set $new_url to whatever you desire. <?php // Requires PHP 5.4+. add_action( ‘admin_bar_menu’, function( $wp_admin_bar ) { $new_url=”http://example.com/custom/location”; if ( $wp_admin_bar->get_node( ‘my-account’) ) { $wp_admin_bar->add_node( [ ‘id’ => ‘my-account’, ‘href’ => $new_url, … Read more

How to add pagination to a post loop in a custom BuddyPress tab

This may not be the proper way but it works in BP profile pages … $paged = ( isset( $_GET[‘vp’] ) ) ? $_GET[‘vp’] : 1; $args = array( ‘post_type’ => array( ‘video’ ), ‘author’ => bp_displayed_user_id(), ‘paged’ => $paged, ‘posts_per_page’ => get_option( ‘posts_per_page’ ) ); $author_videos = new WP_Query( $args ); if ( $author_videos->have_posts() … Read more

There was a problem uploading the cover image in buddypress, while uploading profile image?

just change /wp-content/plugins/buddypress/bp-core/bp-core-attachments.php file } // Make sure the file path is safe. if ( 0 !== validate_file( $r[‘image’] ) ) { //this to following one if ( 1 === validate_file( $r[‘image’] ) ) { return false; } $type_subdir = $r[‘object_dir’] . “https://wordpress.stackexchange.com/” . $r[‘item_id’] . “https://wordpress.stackexchange.com/” . $r[‘type’]; $type_dir = trailingslashit( $bp_attachments_uploads_dir[‘basedir’] ) . … Read more

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