Skip to content

Instantly share code, notes, and snippets.

@kalico1
Last active April 4, 2017 04:27
Show Gist options
  • Select an option

  • Save kalico1/a5a95b98088d018d7b5477b4852b8170 to your computer and use it in GitHub Desktop.

Select an option

Save kalico1/a5a95b98088d018d7b5477b4852b8170 to your computer and use it in GitHub Desktop.

Revisions

  1. kalico1 revised this gist Apr 4, 2017. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions index-directory.php
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    <!-- *** GES: THE FIRST PART COMES FROM COMMUNITY.PHP, WHICH IS A CUSTOMIZED VERSION OF THE PARENT THEME'S PAGE.PHP *** -->
    <!-- *** GROUPS INDEX TEMPLATE: THE FIRST PART COMES FROM COMMUNITY.PHP, WHICH IS A CUSTOMIZED VERSION OF THE PARENT THEME'S PAGE.PHP *** -->

    <?php

    @@ -54,7 +54,7 @@



    <!-- *** GES: THIS IS THE PAGE TITLE CODE, COPIED FROM CONTENT-PAGE.PHP *** -->
    <!-- *** GROUPS INDEX TEMPLATE: THIS IS THE PAGE TITLE CODE, COPIED FROM CONTENT-PAGE.PHP *** -->

    <header class="entry-header">

    @@ -65,7 +65,7 @@



    <!-- *** GES: HERE I REPLACED THE LOOP IN COMMUNITY.PHP WITH THE ENTIRE CONTENTS OF GROUPS/INDEX.PHP *** -->
    <!-- *** GROUPS INDEX TEMPLATE: HERE I REPLACED THE LOOP IN COMMUNITY.PHP WITH THE ENTIRE CONTENTS OF GROUPS/INDEX.PHP *** -->

    <?php

    @@ -239,7 +239,7 @@
    do_action( 'bp_after_directory_groups_page' );
    ?>

    <!-- *** GES: THIS IS WHERE THE GROUPS/INDEX.PHP LOOP-REPLACEMENT ENDS, AND MY CUSTOM COMMUNITY.PHP FILE TAKES OVER AGAIN *** -->
    <!-- *** GROUPS INDEX TEMPLATE: THIS IS WHERE THE GROUPS/INDEX.PHP LOOP-REPLACEMENT ENDS, AND MY CUSTOM COMMUNITY.PHP FILE TAKES OVER AGAIN *** -->

    </main><!-- #main -->
    </div><!-- #primary -->
  2. kalico1 revised this gist Mar 24, 2017. 1 changed file with 266 additions and 1 deletion.
    267 changes: 266 additions & 1 deletion index-directory.php
    Original file line number Diff line number Diff line change
    @@ -1 +1,266 @@
    test
    <!-- *** GES: THE FIRST PART COMES FROM COMMUNITY.PHP, WHICH IS A CUSTOMIZED VERSION OF THE PARENT THEME'S PAGE.PHP *** -->

    <?php

    /**
    * The template for displaying all BuddyPress pages (NROC Community).
    * This template can be overridden by more specific templates using the BuddyPress template hierarchy. (See the "community" directory.)
    * This is the template that displays all pages by default.
    * Please note that this is the WordPress construct of pages
    * and that other 'pages' on your WordPress site will use a
    * different template.
    *
    * @package zerif
    */

    get_header(); ?>
    <div class="clear"></div>
    </header> <!-- / END HOME SECTION -->

    <?php
    zerif_after_header_trigger();
    $zerif_change_to_full_width = get_theme_mod( 'zerif_change_to_full_width' );
    ?>

    <div id="content" class="site-content">
    <div class="container">
    <?php zerif_before_page_content_trigger(); ?>
    <?php
    if( (function_exists('is_cart') && is_cart()) || (function_exists('is_checkout') && is_checkout() ) || (function_exists('is_account_page') && is_account_page()) || !empty($zerif_change_to_full_width) ) {
    echo '<div class="content-left-wrap col-md-12 community-php">';
    }


    elseif (bp_is_my_profile() || bp_is_user_profile() || bp_is_group_single() || bp_is_member() ) {
    echo '<div class="content-left-wrap col-md-12 community-php">';
    }

    else {
    echo '<div class="content-left-wrap col-md-9 community-php">';
    }
    ?>
    <?php zerif_top_page_content_trigger(); ?>
    <div id="primary" class="content-area community-php">
    <main itemscope itemtype="http://schema.org/WebPageElement" itemprop="mainContentOfPage" id="main" class="site-main" role="main">



    <!-- *** GES: THIS IS THE PAGE TITLE CODE, COPIED FROM CONTENT-PAGE.PHP *** -->

    <header class="entry-header">

    <?php zerif_page_header_trigger(); ?>

    </header><!-- .entry-header -->




    <!-- *** GES: HERE I REPLACED THE LOOP IN COMMUNITY.PHP WITH THE ENTIRE CONTENTS OF GROUPS/INDEX.PHP *** -->

    <?php


    /**
    * BuddyPress - Groups
    *
    * @package BuddyPress
    * @subpackage bp-legacy
    */

    /**
    * Fires at the top of the groups directory template file.
    *
    * @since 1.5.0
    */
    do_action( 'bp_before_directory_groups_page' ); ?>

    <div id="buddypress">

    <?php

    /**
    * Fires before the display of the groups.
    *
    * @since 1.1.0
    */
    do_action( 'bp_before_directory_groups' ); ?>

    <?php

    /**
    * Fires before the display of the groups content.
    *
    * @since 1.1.0
    */
    do_action( 'bp_before_directory_groups_content' ); ?>

    <?php /* Backward compatibility for inline search form. Use template part instead. */ ?>
    <?php if ( has_filter( 'bp_directory_groups_search_form' ) ) : ?>

    <div id="group-dir-search" class="dir-search" role="search">
    <?php bp_directory_groups_search_form(); ?>
    </div><!-- #group-dir-search -->

    <?php else: ?>

    <?php bp_get_template_part( 'common/search/dir-search-form' ); ?>

    <?php endif; ?>

    <div style="float: left; margin-bottom: 10px;">
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed dictum laoreet justo id varius. Nullam ornare quam eu sem aliquam elementum. Vestibulum et ultrices mauris, euismod gravida purus. Quisque consectetur velit a leo consectetur sollicitudin. Suspendisse varius scelerisque pretium. Duis nec luctus erat, tincidunt euismod dolor.
    </div>



    <form action="" method="post" id="groups-directory-form" class="dir-form">

    <div id="template-notices" role="alert" aria-atomic="true">
    <?php

    /** This action is documented in bp-templates/bp-legacy/buddypress/activity/index.php */
    do_action( 'template_notices' ); ?>

    </div>

    <div class="item-list-tabs" aria-label="<?php esc_attr_e( 'Groups directory main navigation', 'buddypress' ); ?>">
    <ul>
    <li class="selected" id="groups-all"><a href="<?php bp_groups_directory_permalink(); ?>"><?php printf( __( 'All Groups %s', 'buddypress' ), '<span>' . bp_get_total_group_count() . '</span>' ); ?></a></li>

    <?php if ( is_user_logged_in() && bp_get_total_group_count_for_user( bp_loggedin_user_id() ) ) : ?>
    <li id="groups-personal"><a href="<?php echo bp_loggedin_user_domain() . bp_get_groups_slug() . '/my-groups/'; ?>"><?php printf( __( 'My Groups %s', 'buddypress' ), '<span>' . bp_get_total_group_count_for_user( bp_loggedin_user_id() ) . '</span>' ); ?></a></li>
    <?php endif; ?>

    <?php

    /**
    * Fires inside the groups directory group filter input.
    *
    * @since 1.5.0
    */
    do_action( 'bp_groups_directory_group_filter' ); ?>

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

    <div class="item-list-tabs" id="subnav" aria-label="<?php esc_attr_e( 'Groups directory secondary navigation', 'buddypress' ); ?>" role="navigation">
    <ul>
    <?php

    /**
    * Fires inside the groups directory group types.
    *
    * @since 1.2.0
    */
    do_action( 'bp_groups_directory_group_types' ); ?>

    <li id="groups-order-select" class="last filter">

    <label for="groups-order-by"><?php _e( 'Order By:', 'buddypress' ); ?></label>

    <select id="groups-order-by">
    <option value="active"><?php _e( 'Last Active', 'buddypress' ); ?></option>
    <option value="alphabetical"><?php _e( 'Alphabetical', 'buddypress' ); ?></option>
    <option value="newest"><?php _e( 'Newly Created', 'buddypress' ); ?></option>
    <option value="popular"><?php _e( 'Most Members', 'buddypress' ); ?></option>

    <?php

    /**
    * Fires inside the groups directory group order options.
    *
    * @since 1.2.0
    */
    do_action( 'bp_groups_directory_order_options' ); ?>
    </select>
    </li>
    </ul>
    </div>

    <h2 class="bp-screen-reader-text"><?php
    /* translators: accessibility text */
    _e( 'Groups directory', 'buddypress' );
    ?></h2>

    <div id="groups-dir-list" class="groups dir-list">
    <?php bp_get_template_part( 'groups/groups-loop' ); ?>
    </div><!-- #groups-dir-list -->

    <?php

    /**
    * Fires and displays the group content.
    *
    * @since 1.1.0
    */
    do_action( 'bp_directory_groups_content' ); ?>

    <?php wp_nonce_field( 'directory_groups', '_wpnonce-groups-filter' ); ?>

    <?php

    /**
    * Fires after the display of the groups content.
    *
    * @since 1.1.0
    */
    do_action( 'bp_after_directory_groups_content' ); ?>

    </form><!-- #groups-directory-form -->

    <?php

    /**
    * Fires after the display of the groups.
    *
    * @since 1.1.0
    */
    do_action( 'bp_after_directory_groups' ); ?>

    </div><!-- #buddypress -->

    <?php

    /**
    * Fires at the bottom of the groups directory template file.
    *
    * @since 1.5.0
    */
    do_action( 'bp_after_directory_groups_page' );
    ?>

    <!-- *** GES: THIS IS WHERE THE GROUPS/INDEX.PHP LOOP-REPLACEMENT ENDS, AND MY CUSTOM COMMUNITY.PHP FILE TAKES OVER AGAIN *** -->

    </main><!-- #main -->
    </div><!-- #primary -->
    </div><!-- .container -->

    <?php



    if (bp_is_my_profile() || bp_is_user_profile() || bp_is_group_single() || bp_is_member() ) {
    // no sidebar
    }
    else {

    echo '<div class="sidebar-wrap col-md-3 content-left-wrap">';
    get_sidebar();
    echo "</div>";
    }


    ?>

    </div><!-- .site-content -->
    <?php get_footer(); ?>
  3. kalico1 renamed this gist Mar 24, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. kalico1 created this gist Mar 24, 2017.
    1 change: 1 addition & 0 deletions test
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    test