Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #285153

    designerken
    Participant

    I have read lots of requests both here on on tri.be you point to the plug-in they point to the theme developer.

    I am curious if anyone as made headway getting X and The Events Calendar working properly?

    My problem is that there is no title or breadcrumbs for the main page (http://urlgone.com/1cf9dc/) since the plug-in actually creates that slug and is not a real page in the WordPress backend.

    Next issue is then going from Month view to List view or Day View (http://urlgone.com/ed9f52/). I get a title on this page but it is a “OOPS” and “404 page” is in the breadcrumbs. I can only assume that the other views when purchasing their PRO upgrade will give me the same error.

    I know your policy is to not assist with 3rd party plug-ins however with plug-ins with over 200,000+ active installations is hard to just write it off as not being able to help. I would welcome some basic integration into future versions of X as their new-ish template system can be overridden similar to WooCommerce and popular plug-ins.

    Any insight you might be able to provide as to what is happening or of a fix would be greatly appreciated.

    Sorry for the temporary URLS this is a dev site and I dont want the URLS floating out there in cyberspace.

    #285576

    Rad
    Moderator

    Hi there,

    Thanks for writing in.

    There is no assurance that all 3rd party plugin will 100% work on a theme. But there is always a solution, and it’s called integration.

    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 :

    // 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;

    This is X’s code for breadcrumbs, and adding that code at your child theme’s functions.php will simply override the main X’s breadcrumb. And if you will observe, there are other plugins that are integrated too.

    Next issue, All plugins that uses multiple post types with configured url slug always require re-flushing of permalinks. And you can do that by going to Admin > Settings > Permalinks and simply re-save it. If not, you will get 404 messages on new pages related to the plugin that relies on permalinks.

    Thanks.

    #285896

    designerken
    Participant

    Thanks for the reply and the breadcrumbs code.

    I agree with you that it’s never 100% assurance that 3rd party plugins will work. I wont dispute that. My gripe is that in the searches that I read the X-team would put it on the plugin developers and the ECP-team would put it back on the theme developers. Leaving us in the middle…frustrated.

    I appreciate the code snippet, I think I might have a solution to use that. Using their code of tribe_is_month ( ) to determine if it is the calendar view.

    However there is still the issue that there is no title on that page.

    Regarding the permalinks I had flushed those several times thinking that was the issue. But that was to no avail as I still get a 404 error in the breadcrumbs and the OOPs title.

    #286520

    Rad
    Moderator

    Hi there,

    In that case, let me check it too 🙂

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks!

    #286929

    designerken
    Participant
    This reply has been marked as private.
    #287424

    Rad
    Moderator

    Hi there,

    As you referred this url https://pippinsplugins.com/use-the_title-and-the_title_attribute-correctly/ the useful part of the_title_attribute() is esc_attr(). That is the main function that fixes un-escaped quotes that causes My Download”>My Download issue.

    Check this out https://codex.wordpress.org/Function_Reference/esc_attr

    In X, we use this https://codex.wordpress.org/Function_Reference/esc_attr_e for one main reason. The translation 🙂

    Like this :

    title="<?php esc_attr_e( "Hello World", "__x__" ); ?>"

    And the_title_attribute() is okay too, but it’s not translatable.

    Thanks!

    #288171

    designerken
    Participant
    This reply has been marked as private.
    #288405

    Paul R
    Moderator

    Hi,

    I would like to check again but the wordpress login credentials you have provided no longer works.

    Kindly check again and let us know.

    Thanks

    #288687

    designerken
    Participant

    Not sure why. Worked for me.

    #289367

    Rad
    Moderator

    Hi there,

    I think you should contact the plugin author of how their feature works 🙂 Looks like the plugin uses special function that gets tribe event title. Since it’s not a page, category, or etc, then the_title() will not work. I think it’s more related to tribe_get_events()

    $events = tribe_get_events();
    
    while ($events) {
    $event->post_title;
    }

    Unfortunately, we’re not the author of the plugin and we aren’t sure how it works.

    And I’m not getting 404 on that page anymore.

    Thanks for understanding.

    #289881

    designerken
    Participant

    Thanks I will work with the plug-in dev team and reference the topic. I will post back here my findings.

    What did you do to get rid of the 404 page?

    #290612

    Paul R
    Moderator

    Yes, please let us know how it goes.

    With regards to 404 pages, I wasn’t getting that error when I check.

    #291211

    designerken
    Participant

    Since the events are a custom post type (CPT) the issue with the title? Since it doesn’t know how to handle those post types?

    I am having a similar issue with Easy Digital Downloads (EDD) where no title or “The Blog” with no breadcumbs appear either.

    So if it is that they are CPTs, how or can we add our own post types into X-theme? Is there a hook we can tap into? Can you provide an example if one exists or recommend a solution?

    #291779

    Rad
    Moderator

    Hi there,

    Your breadcrumbs appear on blog area. Or maybe I misunderstood it 🙂

    Yes, it’s because they are CPT. Some are more advance that they have their own functions to implement them properly. X theme has no limit, it will work to any CPT, the only need is to integrate them to the place you wish them available. Like if you wish to display breadcrumbs for CPT properly, then add the integration within the breadcrumbs code provided above.

    If you wish to make it easier, install some advance breadcrumb, like the one from SEO Yoast plugin. And let it handle your CPT breadcrumbs then integrate it to X’s breadcrumb.

    Example, https://community.theme.co//forums/topic/messed-the-whole-lf/#post-80205 ( this is old so please use the breadcrumbs code above as reference )

    Thanks!

    #292814

    designerken
    Participant

    Yes I suppose the breadcrumbs are appearing but it is only showing the home icon and delimiter for a few of the pages and not the actual page it is on.

    I have been using the code to integrate the conditional statements from ECP but cannot seem to get them all working:

    http://ehs.designerken.com/event/concert-wind-ensemble-rehearsal-6/
    http://ehs.designerken.com/organizer/ehs-band/
    http://ehs.designerken.com/venue/edison-high-school/

    All of these pages are single pages yet they are being treated as blog pages (at least that is what the title of the page is displaying.

    I know that the correct code is being called for the displaying of the crumbs but its not putting the right title in. Here is a pastebin (http://pastebin.com/9PvzjS73) of the code.