Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hashtags in the activity feed


  • Koka boka
    Participant

    @koka777

    Hi, I don’t know where to dig anymore, I’m trying to attach hashtags to the activity feed. I’ve created a separate page and I’m trying to call the entry.php template but it’s not loading properly!
    For some reason the styles are not loading correctly. I have attached screenshots.
    https://prnt.sc/jEms0Zul8TVY
    https://prnt.sc/Roy5fmcWPZCV
    And here is the page code itself:

    <?php
    /*
    Template Name: Hashtag Page
    */
    
    get_header(); ?>
    
    <div class="activity" data-bp-single="<?php echo esc_attr( bp_current_action() ); ?>">
    
        <?php
        if ( isset( $_GET['tag'] ) ) {
            $hashtag = sanitize_text_field( $_GET['tag'] );
            echo '<h1>Hashtag : #' . esc_html( $hashtag ) . '</h1>';
    
            // Використання BP_Loop для отримання активностей
            if ( bp_has_activities( array( 'search_terms' => '#' . $hashtag ) ) ) : ?>
                <ul id="activity-stream" class="activity-list item-list bp-list" data-bp-list="activity">
                    <?php while ( bp_activities() ) : bp_the_activity(); ?>
                        <?php bp_get_template_part( 'activity/entry' ); ?>
                    <?php endwhile; ?>
                </ul>
            <?php else : ?>
                <p>Hashtag.</p>
            <?php endif;
        } else {
            echo '<p>Hashtag.</p>';
        }
        ?>
    
    </div><!-- #primary -->
    
    <?php
    get_footer();
    ?>

    I will be glad for any suggestion.

  • You must be logged in to reply to this topic.
Skip to toolbar