2

I am new to WordPress and Buddy-Press but would like to know how to use messaging inside my own template as per my client requirement ? I have been through Buddy Press forums and could not get enough help as well. Her is the code I am currently using from buddy-press message>single page.

<?php
/**
 * BuddyPress - Users Messages
 *
 * @package BuddyPress
 * @subpackage bp-legacy
 */
?>

<div class="item-list-tabs no-ajax" id="subnav" role="navigation">
<ul>

    <?php bp_get_options_nav(); ?>

</ul>

<?php if ( bp_is_messages_inbox() || bp_is_messages_sentbox() ) : ?>

    <div class="message-search"><?php bp_message_search_form(); ?></div>

<?php endif; ?>

</div><!-- .item-list-tabs -->

<?php
switch ( bp_current_action() ) :

    // Inbox/Sentbox
    case 'inbox'   :
    case 'sentbox' :

        /**
         * Fires before the member messages content for inbox and sentbox.
         *
         * @since 1.2.0
         */
        do_action( 'bp_before_member_messages_content' ); ?>
    <div class="messages">
        <?php bp_get_template_part( 'members/single/messages/messages-loop' ); ?>
    </div><!-- .messages -->

    <?php

    /**
     * Fires after the member messages content for inbox and sentbox.
     *
     * @since 1.2.0
     */
    do_action( 'bp_after_member_messages_content' );
    break;

// Single Message View
case 'view' :
    bp_get_template_part('members/single/messages/single' );
    break;

// Compose
case 'compose' :
    bp_get_template_part( 'members/single/messages/compose' );
    break;

// Sitewide Notices
case 'notices' :

    /**
     * Fires before the member messages content for notices.
     *
     * @since 1.2.0
     */
    do_action( 'bp_before_member_messages_content' ); ?>

    <div class="messages">
        <?php bp_get_template_part( 'members/single/messages/notices-loop' ); ?>
    </div><!-- .messages -->

    <?php

    /**
     * Fires after the member messages content for inbox and sentbox.
     *
     * @since 1.2.0
     */
    do_action( 'bp_after_member_messages_content' );
    break;

// Any other
default :
    bp_get_template_part( 'members/single/plugins' );
    break;
endswitch; ?>

This is buddy-press's single page message template content. But it does not show anything on my own template?

Can anyone guide me that how can I use buddy press messaging from my own template? So, that my clients can chat with each other from that specific template rather than default buddy press page ... ???

Waiting for any helpfull material, please?

Sunil Garg
  • 14,608
  • 25
  • 132
  • 189
  • Did you check [Private Messages Loop]( https://codex.buddypress.org/developer/loops-reference/the-private-messages-loop-bp_has_message_threads/) –  Feb 22 '17 at 16:35

0 Answers0