Garrett

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Need help listing organizer categories #1242416
    Garrett
    Participant

    Thanks Nico!

    I checked out your code and it was creating a lot of

      in the html that were unnecessary, and seemed to be originating from the logic.

      I updated your code here, and commented out the original pieces so you can easily see the changes. What i’m left with is a very clean output:

      <ul class="orglist">
        <li class="orglist-org">Org 1 Name</li>
          <ul>
            <li class="orglist-category">Cat1</li>
          </ul>
        <li class="orglist-org">Org 2 name</li>
          <ul>
            <li class="orglist-category">Cat1</li>
            <li class="orglist-category">Cat2</li>
            <li class="orglist-category">Cat3</li>\
          </ul>
      </ul>

      Here’s the updated code, and thanks again!:

      //CUSTOM ORGANIZER LIST //
      // Sample code for custom organizer list
      // [tribe_custom_organizers]
      function do_tribe_custom_organizers( $atts ){
           
          $output = '';
       
          $organizers = tribe_get_organizers ( );
       
          if ( !empty($organizers) ) $output .= '<ul class="orglist">';
       
          foreach ( $organizers as $organizer ) {
               
              // Add Organizer
              // use tribe_get_organizer_link to get the link
              $output .= '<li class="orglist-org">' . $organizer->post_title . '</li>';
       
              // get organizer events (upcoming)
              $args = array( 
                          'organizer'      => $organizer->ID,
                          'eventDisplay'   => 'list',
                          'posts_per_page' => -1,
                      );
       
              $events = Tribe__Events__Query::getEvents( $args, false );
       
              // get the cats
              $organizer_cats = array();
      		$output .= '<ul>';
              foreach ( $events as $event ) {
                   
                  $event_cats = get_the_terms( $event->ID, Tribe__Events__Main::TAXONOMY );
                   
                  //if( !empty($event_cats) ) $output .= '<ul>';
       
                  foreach ( $event_cats as $cat ) {
      				
                      // avoid printig the term more than once
                      if ( !in_array( $cat->term_id, $organizer_cats) ) {
       
                          $organizer_cats[] = $cat->term_id;
       
                          // use get_term_link to link the term
                          $output .= '<li class="orglist-category">' . $cat->name . '</li>';
                      }
                  }
       
                  //if( !empty($event_cats) ) $output .= '</ul>';
                   
              }
      		$output .='</ul>';
          }
       
          if ( !empty($organizers) ) $output .= '</ul>';
       
          return $output;
      }
      add_shortcode( 'tribe_custom_organizers', 'do_tribe_custom_organizers' );
      in reply to: Custom Fields for community/add page, Organizer Section #1242414
      Garrett
      Participant

      Thanks for this George; however, it’s off base from what my original question was.

      I don’t need to necessarily add filters to require fields that are already there, but I do need to be able to add fields to the form.

      Can you please at least point me in the right direction here? It would save a lot of time if I knew where these fields are populated from, specifically the organizer fields on the /community/add page.

      in reply to: Need help listing organizer categories #1234214
      Garrett
      Participant

      Thanks for the help! I think we’re 90% of the way there. It seems to be outputting the entire array as well as our intended results:

      CURRENT OUTPUT:

      array(1) { [0]=> object(WP_Term)#1787 (10) { [“term_id”]=> int(3) [“name”]=> string(14) “Climate Change” [“slug”]=> string(14) “climate-change” [“term_group”]=> int(0) [“term_taxonomy_id”]=> int(3) [“taxonomy”]=> string(16) “tribe_events_cat” [“description”]=> string(0) “” [“parent”]=> int(0) [“count”]=> int(4) [“filter”]=> string(3) “raw” } } array(3) { [0]=> object(WP_Term)#1789 (10) { [“term_id”]=> int(2) [“name”]=> string(12) “Civil Rights” [“slug”]=> string(12) “civil-rights” [“term_group”]=> int(0) [“term_taxonomy_id”]=> int(2) [“taxonomy”]=> string(16) “tribe_events_cat” [“description”]=> string(0) “” [“parent”]=> int(0) [“count”]=> int(4) [“filter”]=> string(3) “raw” } [1]=> object(WP_Term)#1790 (10) { [“term_id”]=> int(3) [“name”]=> string(14) “Climate Change” [“slug”]=> string(14) “climate-change” [“term_group”]=> int(0) [“term_taxonomy_id”]=> int(3) [“taxonomy”]=> string(16) “tribe_events_cat” [“description”]=> string(0) “” [“parent”]=> int(0) [“count”]=> int(4) [“filter”]=> string(3) “raw” } [2]=> object(WP_Term)#1786 (10) { [“term_id”]=> int(5) [“name”]=> string(14) “Women’s Rights” [“slug”]=> string(13) “womens-rights” [“term_group”]=> int(0) [“term_taxonomy_id”]=> int(5) [“taxonomy”]=> string(16) “tribe_events_cat” [“description”]=> string(0) “” [“parent”]=> int(0) [“count”]=> int(2) [“filter”]=> string(3) “raw” } } array(1) { [0]=> object(WP_Term)#1648 (10) { [“term_id”]=> int(3) [“name”]=> string(14) “Climate Change” [“slug”]=> string(14) “climate-change” [“term_group”]=> int(0) [“term_taxonomy_id”]=> int(3) [“taxonomy”]=> string(16) “tribe_events_cat” [“description”]=> string(0) “” [“parent”]=> int(0) [“count”]=> int(4) [“filter”]=> string(3) “raw” } } array(2) { [0]=> object(WP_Term)#1789 (10) { [“term_id”]=> int(2) [“name”]=> string(12) “Civil Rights” [“slug”]=> string(12) “civil-rights” [“term_group”]=> int(0) [“term_taxonomy_id”]=> int(2) [“taxonomy”]=> string(16) “tribe_events_cat” [“description”]=> string(0) “” [“parent”]=> int(0) [“count”]=> int(4) [“filter”]=> string(3) “raw” } [1]=> object(WP_Term)#1653 (10) { [“term_id”]=> int(3) [“name”]=> string(14) “Climate Change” [“slug”]=> string(14) “climate-change” [“term_group”]=> int(0) [“term_taxonomy_id”]=> int(3) [“taxonomy”]=> string(16) “tribe_events_cat” [“description”]=> string(0) “” [“parent”]=> int(0) [“count”]=> int(4) [“filter”]=> string(3) “raw” } } array(1) { [0]=> object(WP_Term)#1786 (10) { [“term_id”]=> int(5) [“name”]=> string(14) “Women’s Rights” [“slug”]=> string(13) “womens-rights” [“term_group”]=> int(0) [“term_taxonomy_id”]=> int(5) [“taxonomy”]=> string(16) “tribe_events_cat” [“description”]=> string(0) “” [“parent”]=> int(0) [“count”]=> int(2) [“filter”]=> string(3) “raw” } }
      – Hawaii Action Network
      — Climate Change
      — Civil Rights
      — Women’s Rights

      Also, is there a way to output in list form?

      Such as:

      • Hawaii Action Network
      • Climate Change
      • Civil Rights
      • Women’s Rights

      Thanks so much!

      in reply to: bumpdown.min.js issue? #1230345
      Garrett
      Participant

      Hey guys,

      I am having a similar issue with bumpdown.min.js and have traced it to a theme conflict with borderland theme by elated themes.

      That said, was there any fix for this?

      I am also going to see if downgrading the plugin helps and report back here in case it’s helpful to your Dev team at all

    Viewing 4 posts - 1 through 4 (of 4 total)