Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to display “activity_update”?


  • mutoha
    Participant

    @mutoha

    I want to display only activity_update in 【fluits_content.php】.

    So, 【fluits_content.php】 was added by writing the following code in 【bp-custom.php】.

    ▼【wp-content\plugins\bp-custom.php】

    <?php
     
    add_action( 'bp_setup_nav', 'fluits_nav');  
    
    function fluits_nav() {  
      global $bp;  
      bp_core_new_nav_item( 
        array(   
          'name' => '果物',
          'slug' => 'fluits',
          'position' => 75,
          'screen_function' => 'fluits',  
          'show_for_displayed_user' => true, 
          'default_subnav_slug' => 'fluits',
          'item_css_id' => 'fluits'
        )
      );  
    }  
        
    function fluits_title() {  
      echo '果物'; 
    }  
        
    function fluits () {  
      add_action( 'bp_template_title', 'fluits_title' );
      add_action( 'bp_template_content', 'fluits_content' );  
      bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );  
    }  
    
    function fluits_content() {  
      include_once "buddypress/custom_user/fluits_content.php";     
    }  
    
    ?>

    But if I wrote the following code in 【fluits_content.php】, the list of activity_update will not be output.

    ▼【wp-content\plugins\buddypress\custom_user\fluits_content.php】

    <div class="activity_update_wrapper">
    <?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) . '&action=activity_update' ) ) : ?>
        <?php while ( bp_activities() ) : bp_the_activity(); ?>
     
    	<?php get_template_part( 'bp-templates/bp-legacy/buddypress/activity/entry.php' ) ?>
    				
        <?php endwhile; ?>
    <?php endif; ?>
    </div>

    How do I display only “activity_update” in “fluits_content.php”?

    Thanks.

Viewing 1 replies (of 1 total)

  • mutoha
    Participant

    @mutoha

    I solved!

    ▼【wp-content\plugins\buddypress\custom_user\fluits_content.php】

    <div class="activity_update_wrapper">
    <?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) . '&action=activity_update' ) ) : ?>
        <?php while ( bp_activities() ) : bp_the_activity(); ?>
     
    	<?php bp_get_template_part( 'activity/entry' ); ?>
    				
        <?php endwhile; ?>
    <?php endif; ?>
    </div>

    Thanks.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar