X-theme + ECP integration issues (no title/breadcrumbs)

Home Forums Calendar Products Events Calendar PRO X-theme + ECP integration issues (no title/breadcrumbs)

Viewing 15 posts - 1 through 15 (of 30 total)
  • Author
    Posts
  • #966630
    Ken Charity
    Participant

    I have a thread started with the theme developers but they have helped as much as they can and state they do not support 3rd party plug-ins.

    Thread link: https://theme.co/community/forums/topic/the-events-calendar-integration-issue/#post-289367

    My primary issue is that I do not have titles/breadcrumbs appearing on my calendar pages. I assume this is due to the way that ECP creates those pages in combination on how titles/breadcrumbs are created in x-theme.

    The event manager plugin is not really integrated to the theme. X theme’s breadcrumbs is usually integrated to the common post types such as post, page, attachment, custom types and etc. And post types are standard feature of wordpress.

    If you will check the source code of this page http://ehs.designerken.com/events/month/ , there is no indication of what type it is. It’s not even archive, or category, page, post, or etc. And X’s breadcrumb is only configured to standard pages.

    What you could do is ask the plugin author for the code that is need for integration. You can simply put your integration code within this code :

    I guess I could as for a way to add in custom post types and add your post type into theirs if possible.

    They did supply me with the code for the function of their breadcrumbs that I guess can be changed to include the necessary code for ECP.

    // Breadcrumbs
    // =============================================================================
    
    if ( ! function_exists( 'x_breadcrumbs' ) ) :
      function x_breadcrumbs() {
    
        if ( x_get_option( 'x_breadcrumb_display', '1' ) ) {
    
          GLOBAL $post;
    
          $is_ltr         = ! is_rtl();
          $stack          = x_get_stack();
          $delimiter      = x_get_breadcrumb_delimiter();
          $home_text      = x_get_breadcrumb_home_text();
          $home_link      = home_url();
          $current_before = x_get_breadcrumb_current_before();
          $current_after  = x_get_breadcrumb_current_after();
          $page_title     = get_the_title();
          $blog_title     = get_the_title( get_option( 'page_for_posts', true ) );
    
          if ( ! is_404() ) {
            $post_parent = $post->post_parent;
          } else {
            $post_parent = '';
          }
    
          if ( X_WOOCOMMERCE_IS_ACTIVE ) {
            $shop_url   = x_get_shop_link();
            $shop_title = x_get_option( 'x_' . $stack . '_shop_title', __( 'The Shop', '__x__' ) );
            $shop_link  = '<a href="'. $shop_url .'">' . $shop_title . '</a>';
          }
    
          echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter;
    
            if ( is_home() ) {
    
              echo $current_before . $blog_title . $current_after;
    
            } elseif ( is_category() ) {
    
              $the_cat = get_category( get_query_var( 'cat' ), false );
              if ( $the_cat->parent != 0 ) echo get_category_parents( $the_cat->parent, TRUE, $delimiter );
              echo $current_before . single_cat_title( '', false ) . $current_after;
    
            } elseif ( x_is_product_category() ) {
    
              if ( $is_ltr ) {
                echo $shop_link . $delimiter . $current_before . single_cat_title( '', false ) . $current_after;
              } else {
                echo $current_before . single_cat_title( '', false ) . $current_after . $delimiter . $shop_link;
              }
    
            } elseif ( x_is_product_tag() ) {
    
              if ( $is_ltr ) {
                echo $shop_link . $delimiter . $current_before . single_tag_title( '', false ) . $current_after;
              } else {
                echo $current_before . single_tag_title( '', false ) . $current_after . $delimiter . $shop_link;
              }
    
            } elseif ( is_search() ) {
    
              echo $current_before . __( 'Search Results for ', '__x__' ) . '“' . get_search_query() . '”' . $current_after;
    
            } elseif ( is_singular( 'post' ) ) {
    
              if ( get_option( 'page_for_posts' ) == is_front_page() ) {
                echo $current_before . $page_title . $current_after;
              } else {
                if ( $is_ltr ) {
                  echo '<a href="' . get_permalink( get_option( 'page_for_posts' ) ) . '">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
                } else {
                  echo $current_before . $page_title . $current_after . $delimiter . '<a href="' . get_permalink( get_option( 'page_for_posts' ) ) . '">' . $blog_title . '</a>';
                }
              }
    
            } elseif ( x_is_portfolio() ) {
    
              echo $current_before . get_the_title() . $current_after;
    
            } elseif ( x_is_portfolio_item() ) {
    
              $link  = x_get_parent_portfolio_link();
              $title = x_get_parent_portfolio_title();
    
              if ( $is_ltr ) {
                echo '<a href="' . $link . '">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after;
              } else {
                echo $current_before . $page_title . $current_after . $delimiter . '<a href="' . $link . '">' . $title . '</a>';
              }
    
            } elseif ( x_is_product() ) {
    
              if ( $is_ltr ) {
                echo $shop_link . $delimiter . $current_before . $page_title . $current_after;
              } else {
                echo $current_before . $page_title . $current_after . $delimiter . $shop_link;
              }
    
            } elseif ( x_is_buddypress() ) {
    
              if ( bp_is_group() ) {
                echo '<a href="' . bp_get_groups_directory_permalink() . '">' . x_get_option( 'x_buddypress_groups_title', __( 'Groups', '__x__' ) ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after;
              } elseif ( bp_is_user() ) {
                echo '<a href="' . bp_get_members_directory_permalink() . '">' . x_get_option( 'x_buddypress_members_title', __( 'Members', '__x__' ) ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after;
              } else {
                echo $current_before . x_buddypress_get_the_title() . $current_after;
              }
    
            } elseif ( x_is_bbpress() ) {
    
              remove_filter( 'bbp_no_breadcrumb', '__return_true' );
    
              if ( bbp_is_forum_archive() ) {
                echo $current_before . bbp_get_forum_archive_title() . $current_after;
              } else {
                echo bbp_get_breadcrumb();
              }
    
              add_filter( 'bbp_no_breadcrumb', '__return_true' );
    
            } elseif ( is_page() && ! $post_parent ) {
    
              echo $current_before . $page_title . $current_after;
    
            } elseif ( is_page() && $post_parent ) {
    
              $parent_id   = $post_parent;
              $breadcrumbs = array();
    
              if ( is_rtl() ) {
                echo $current_before . $page_title . $current_after . $delimiter;
              }
    
              while ( $parent_id ) {
                $page          = get_page( $parent_id );
                $breadcrumbs[] = '<a href="' . get_permalink( $page->ID ) . '">' . get_the_title( $page->ID ) . '</a>';
                $parent_id     = $page->post_parent;
              }
    
              if ( $is_ltr ) {
                $breadcrumbs = array_reverse( $breadcrumbs );
              }
    
              for ( $i = 0; $i < count( $breadcrumbs ); $i++ ) {
                echo $breadcrumbs[$i];
                if ( $i != count( $breadcrumbs ) -1 ) echo $delimiter;
              }
    
              if ( $is_ltr ) {
                echo $delimiter . $current_before . $page_title . $current_after;
              }
    
            } elseif ( is_tag() ) {
    
              echo $current_before . single_tag_title( '', false ) . $current_after;
    
            } elseif ( is_author() ) {
    
              GLOBAL $author;
              $userdata = get_userdata( $author );
              echo $current_before . __( 'Posts by ', '__x__' ) . '“' . $userdata->display_name . $current_after . '”';
    
            } elseif ( is_404() ) {
    
              echo $current_before . __( '404 (Page Not Found)', '__x__' ) . $current_after;
    
            } elseif ( is_archive() ) {
    
              if ( x_is_shop() ) {
                echo $current_before . $shop_title . $current_after;
              } else {
                echo $current_before . __( 'Archives ', '__x__' ) . $current_after;
              }
    
            }
    
          echo '</div>';
    
        }
    
      }
    endif;

    That however still leads me with the issue of the Title.

    Any luck with providing the needed code for the breadcrumbs and title integration?

    #966866
    Brian
    Keymaster

    Hi,

    Sorry for the issues you are having.

    We are also limited on support 3rd party coding and not able to provide all the coding for this.

    However, I can try to help you get started on it.

    The Events are a custom post type called tribe_events

    And the Event views are archives and not pages, which is usually the issue. In Genesis this causes their breadcrumbs to just show it as home.

    Anyway to target specific event views we have a list of conditionals:

    https://gist.github.com/jo-snips/2415009

    And for Event View titles we have this function:

    <?php echo tribe_get_events_title(); ?>

    Does that help you get started?

    Cheers!

    #966992
    Ken Charity
    Participant

    Thanks for pointing me in a direction, I’m still a bit foggy, but I will see how it goes. Let’s tackle breadcrumbs first.

    I am assuming using the conditionals you listed I would add them to the elseif statements from the theme developer I would be able to get the breadcrumbs in place? I since you mentioned ECP views are archives would I then add the conditionals specifically to the last elseif targeting is_archive() and append it to the end of if x_is_shop() like this:

    } elseif ( is_archive() ) {
     
              if ( x_is_shop() ) {
                echo $current_before . $shop_title . $current_after;
              
              } elseif ( tribe_is_month() && !is_tax() ) { // Month View Page
    
                echo 'were on the month view page';
    
              } elseif ( tribe_is_month() && is_tax() ) { // Month View Category Page
    
                echo 'were on the month view category page';
    
              } elseif ( tribe_is_past() || tribe_is_upcoming() && !is_tax() ) { // List View Page
    
                echo 'were on the list view page';
    
    			// continue with rest of ECP conditionals...
    
              } else {
                echo $current_before . __( 'Archives ', '__x__' ) . $current_after;
              }
    #967080
    Ken Charity
    Participant

    I’ve been able to get some good progress made in regards to breadcrumb integration.

    I am however having an issue on getting the actual event (single-event) to have a breadcrumb as well as organizers and venues.

    I have a pastebin created Click here.

    Can you take a look as I cannot get the single event page, organizer, or venue to give me the correct breadcrumb. (they are all blank actually).

    Also since there is an ajax call used to change the content in the month view and others, how do I get the breadcrumbs to reflect those changes? For instance if I go back or forward in a month view. Only the current month shows up in the breadcrumbs.

    Once I get those situated I will start another thread to tackle the titles.

    #967138
    Brian
    Keymaster

    Hi,

    I looked at the coding and maybe try using is_singular instead.

    Here are the 3 custom post types:

    tribe_events
    tribe_venue
    tribe_organizer

    I find that is better at determining if on a single custom post type.

    Also since there is an ajax call used to change the content in the month view and others, how do I get the breadcrumbs to reflect those changes? For instance if I go back or forward in a month view. Only the current month shows up in the breadcrumbs.

    You can try moving the coding inside the div that the ajax changes and that might work. Otherwise you would have to come up with a custom script to detect changes to the page and update the breadcrumbs.

    Let me know how that is_singular works out.

    Thanks

    #967279
    Ken Charity
    Participant

    Hey Brian,

    Definitely a step forward, I was able to add those in right above the call to
    } elseif ( is_singular( 'post' ) ) {

    From the original code. I now get breadcrumbs for single event, venue, and organizer.

    But the out put is only “Upcoming Event”.

    I have updated the pastebin with current code: click here

    Pages in question:
    Single Event: http://ehs.designerken.com/event/concert-wind-ensemble-rehearsal-6/
    Venue: http://ehs.designerken.com/venue/edison-high-school/
    Organizer: http://ehs.designerken.com/organizer/ehs-band/

    Titles are still an issue but one thing at a time…

    Quicklinks for reference:
    Month View: http://ehs.designerken.com/events/

    #967293
    Brian
    Keymaster

    On single templates I would look to use the WordPress function get_the_title()

    https://codex.wordpress.org/Function_Reference/get_the_title

    Use that function to display the title of the Event, Venue, and Organizer.

    #967307
    Ken Charity
    Participant

    Ok…I’m a bit lost when would I use

    get_the_title()

    instead of

    tribe_get_events_title()

    So I tried changing the elseif for venue to:

    } elseif ( is_singular( 'tribe_venue' ) ) {
    
    				echo $current_before . get_the_title() . ' checking...' . $current_after;

    And I don’t get a title returned in the breadcrumbs. but I do get “checking…” to show up. So I know that it is using that statement.

    Is this starting to be part of the bigger issue that the title is listed as “Blog”?

    #967336
    Brian
    Keymaster

    The get_the_title should be used for the single views of event, etc only.

    tribe_get_events_title() is for our Event Views such as Month View, List View, Week View, Etc.

    #967345
    Ken Charity
    Participant

    Ah ok I see its for ECP specific titles. got it.

    Still leaves the question as to why is the single event, venue and organizer titles are not appearing. I can’t figure it out.

    #967394
    Brian
    Keymaster

    Not sure why the single title is not working.

    Unfortunately, this is the limit I can help on a customization/theme compatibility issue per our terms and conditions and I am not able to troubleshoot each issue that might come up along the way.

    I do have one more thing for you.

    I would look to passing the event id like this to the get_the_title() function:

    $event_id = get_the_ID();

    get_the_title( $event_id );

    Cheers

    #967469
    Ken Charity
    Participant

    I understand and appreciate you help and patience to this point.

    I just don’t get why the code is not working. I even simplified it to

    function x_breadcrumbs() {
       //  START Checking for singular tribe_event pages
          if ( is_singular( 'tribe_events' ) ) {
          echo get_the_title() . ' this is the single event page';
          } elseif ( is_singular( 'tribe_venue' ) ) {
          echo get_the_title() . ' this is the single venue page';
          } elseif ( is_singular( 'tribe_organizer' ) ) {
          echo get_the_title() . ' this is the single organizer page';
          //  END Checking for singular tribe_event pages
          }
         }

    and that didn’t work. (the hardcoded copy appears properly though)
    I did the same thing for EDD as I needed to check for downloads

    } elseif ( is_singular( 'download' ) ) {
    echo $current_before . get_the_title() . $current_after;

    And that works just fine.

    #967520
    Brian
    Keymaster

    I am not sure. It maybe to early in the templateto get the title and you try and see if get_the_ID(); returns the id for the event if not then you may have to change in the template where the breadcrumbs are called.

    Cheers

    #967637
    Ken Charity
    Participant

    This reply is private.

    #967657
    Brian
    Keymaster

    maybe you can work with the developer of X-theme as now he states it is an ECP issue since even Yoast breadcrumbs cannot bring it up. Can I give them your email?

    I appreciate the offer, but we have a process to go through to make modifications to our plugins. Right now we do not support this and it is considered 3rd party conflict and to resolve it is a customization, which we cannot support.

    If you would like us to add this as a feature I encourage you to visit our User Voice Page and either upvote an existing request or make a new request there.

    http://tribe.uservoice.com/

    Also, I tested on a Genesis site of mine and got get_the_title() to work and show the title for a breadcrumb.

    So it is unclear why it does not work in your theme, but it does work in others.

    Unfortunately, this is again not something we are able to resolve, it could be something we look to resolve in the future, but I do not have a timeline when that might happen.

Viewing 15 posts - 1 through 15 (of 30 total)
  • The topic ‘X-theme + ECP integration issues (no title/breadcrumbs)’ is closed to new replies.