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

    Rad
    Moderator

    Hi there,

    How about let’s do some trial and error.

    Let’s start in simple coding,

    function x_breadcrumbs() {
    
    if ( is_singular('tribe_events') ) {
    echo tribe_get_events_title( );
    } elseif ( is_singular('tribe_organizer') ) {
    echo tribe_get_events_title( );
    } elseif ( is_singular('tribe_venue') ) {
    echo tribe_get_events_title( );
    }
    
    }

    Or perhaps, the very simple one, since they all the same (tribe pages)

    function x_breadcrumbs() {
    
    if ( is_singular('tribe_events') || is_singular('tribe_organizer') || is_singular('tribe_venue') ) {
    echo tribe_get_events_title( );
    } 
    
    }
    

    Or something like this,

    function x_breadcrumbs() {
    
    if ( tribe_is_past() || tribe_is_upcoming() || tribe_is_month() || tribe_is_week() || tribe_is_day() || tribe_is_map() || tribe_is_photo() ||  ) {
    echo tribe_get_events_title( );
    } 
    
    }

    You don’t have to repeat each condition when you’re just displaying the same output.

    echo $current_before . tribe_get_events_title( ) . $current_after;

    Are you sure it’s tribe_get_events_title()? Could you try get_the_title(), it should work since they are single post types.

    And it shows The Blog because it’s not part of the breadcrumbs. It’s part of a landmark which wraps the breadcrumbs. Landmark should be available at /x/framework/views/{YOUR_STACK}/_landmark-header.php ( you can copy this template to your child theme of same folder structure).

    Hope this helps.

    #293580

    designerken
    Participant

    You are correct I can use the pipes to simplify the code with ‘or’ I will probably do that if I decide that I am going to have the same breadcrumbs, but I will probably have a secondary link in there to categories..not sure yet…so I will keep it separated for now. Also it was for testing so that I can echo text for the specific pages during testing (thanks for the code advise though) ๐Ÿ™‚

    as for tribe_get_events_title( ) that is the correct one to use on the calendar/list/day/week/map/photo/ landing pages you are correct on the get_the_title() for the others, sorry I thought I changed it (Ia actually used the variable x-theme used so it was the same code.

    I did try this

      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
          }
         }

    as you can see by going to the pages in the previous post the copy is echoed correctly for each page, but the title is not being output. still a mystery…any further thoughts?

    #294532

    Rad
    Moderator

    Hi there,

    That’s really weird. It should pickup the titles, could you try SEO Yoast breadcrumb too? Let see if it can pickup the title too. If not, then there is really something at your plugin and need some attention from its author.

    https://yoast.com/wordpress/plugins/breadcrumbs/

    function x_breadcrumbs() {
       echo yoast_breadcrumb("","",false);
    }

    I simply used custom post type UI for creating custom post types and I can successfully integrate them using get_the_title() and is_singular(). And your plugin’s custom post type should be just the same unless it’s customized than normal.

    Thanks.

    #294551

    designerken
    Participant

    Ok I activated the SEO plugin and enabled breadcrumbs.

    I have the added the function in functions.php. But still no titles on those pages.

    Here is the debug information from the breadcrumbs page.

    Current option: wpseo_internallinks
    array(18) {
      ["breadcrumbs-404crumb"]=>
      string(25) "Error 404: Page not found"
      ["breadcrumbs-blog-remove"]=>
      bool(false)
      ["breadcrumbs-boldlast"]=>
      bool(true)
      ["breadcrumbs-archiveprefix"]=>
      string(12) "Archives for"
      ["breadcrumbs-enable"]=>
      bool(true)
      ["breadcrumbs-home"]=>
      string(4) "Home"
      ["breadcrumbs-prefix"]=>
      string(0) ""
      ["breadcrumbs-searchprefix"]=>
      string(16) "You searched for"
      ["breadcrumbs-sep"]=>
      string(2) "ยป"
      ["post_types-post-maintax"]=>
      string(8) "category"
      ["post_types-download-maintax"]=>
      string(17) "download_category"
      ["post_types-tribe_events-maintax"]=>
      string(8) "post_tag"
      ["post_types-x-portfolio-maintax"]=>
      string(18) "portfolio-category"
      ["taxonomy-download_category-ptparent"]=>
      int(0)
      ["taxonomy-download_tag-ptparent"]=>
      int(0)
      ["taxonomy-tribe_events_cat-ptparent"]=>
      string(4) "post"
      ["taxonomy-portfolio-tag-ptparent"]=>
      int(0)
      ["taxonomy-portfolio-category-ptparent"]=>
      int(0)
    }
    #294556

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

    Rad
    Moderator

    Sure, but as support, we can’t do that. I’ll just forward this to our developer as they are the one that handles that matter ๐Ÿ™‚

    I’ll see if I can find some solution on my free time ๐Ÿ™‚

    Thanks!

    #295389

    designerken
    Participant

    Thanks for that.

    Here is a something that I played with and had working the best.

    Since I was trying to use the full-width container, header/footer template built in with X-theme that was the template setting I was using in the back end of ECP. You can choose a template of your choice.

    I changed the template from the x-theme template to the ECP default template. All of a sudden I got breadcrumbs. So not sure why their default template seemed to work and why x-theme wasn’t.

    #295839

    Rad
    Moderator

    Hi there,

    The explanation could be simple, it’s their template ๐Ÿ™‚

    Like other plugins, woocommerce, bbpress, and buddypress, we created custom templates to integrate these plugins for X theme. And we followed these plugins’s standard. Their own templates works 100% for themselves, but, we still need to create custom templates just to make sure they works with the theme.

    Similar for Events Calendar plugin, that needs to be integrated too. I can’t tell how as I’m not familiar with this plugin’s standard. The only difference could be that templates for this plugin are selectable.

    Thanks, and glad it works now ๐Ÿ™‚

    #311545

    designerken
    Participant

    I am still running into an issue with the 404 “Page not found” in the <title> tag. Technically the way the plug in works if there is not event on a specific date or week it gives a 404 error for bots. I have changed the breadcrumbs using the calendars conditionals to output ‘no events scheduled’ I have looked at the code in _meta.php file and then wrote a function in my functions.php file that changes the output of the title but cant seem to get it to work. Am I on the right path? What is it thats not working.

    function theme_name_wp_title( $title, $sep ) {
    	if ( is_404() ) {
    		return $title;
    	}
    	
    	global $page, $paged;
    	
    	if ( tribe_is_past() || tribe_is_upcoming() && !is_tax() ) { // List View Page
    			
    		$title .=  __( 'No events scheduled.' , 'ehs' );
    		return $title;
    	
    		} elseif ( tribe_is_day() && !is_tax() ) { // Day View Page
    		return $title;
    
    		$title .=  __( 'No events scheduled.' , 'ehs' );
    		return $title;
    
    		} elseif ( tribe_is_week() && !is_tax() ) { // Week View Page
    
    		$title .=  __( 'No events scheduled.' , 'ehs' );
    		return $title;
    
    		} elseif ( tribe_is_map() && !is_tax() ) { // Map View Page
    
    		$title .=  __( 'No events scheduled.' , 'ehs' );
    		return $title;
    
    		} elseif ( tribe_is_photo() && !is_tax() ) { // Photo View Page
    
    		$title .=  __( 'No events scheduled.' , 'ehs' );
    		return $title;
    
    	} else {
    
    		return $title;
    
    	}
    }
    add_filter( 'wp_title', 'theme_name_wp_title', 10, 2 );
    #311880

    Zeshan
    Member

    Hi there,

    The title could have been overwritten if you are using a plugin such as WordPress SEO by Yoast and you might have to update your code. However, as it is related to a third party plugin or script. Regretfully, we cannot provide support for third party plugins or scripts as our support policy in the sidebar states due to the fact that there is simply no way to account for all of the potential variables at play when using another developer’s plugin or script. Because of this, any questions you have regarding setup, integration, or troubleshooting any piece of functionality that is not native to X will need to be directed to the original developer.

    Thank you for your understanding.

    #312067

    designerken
    Participant

    Yup I know and have read your support policy. This is the problem with using software like yours. You have thousands of instals of your theme, as does The events calendar. When there is a problem with a theme or a plug in, everyone is quick to point to the other guy.

    I don’t mean to come off angry, but more frustrated as we (those that know some code, but not enough) are stuck in the middle of trying to get something done.

    I suppose I can ask the question a different way?

    How do I change the output of the title tag in x-theme when on a 404 page? I am trying to write a conditional statement that changes the title on certain page.

    *Yoast SEO not active.

    #312309

    Rad
    Moderator

    Hi there,

    I understand, but, X theme has no automatic integration and we can’t integrate every software out there. All we could do is integrate what are mostly used. I’m not even familiar with event calendar, but I extended my time getting what’s wrong, just to find out that the limitation is from the plugin itself.

    And what makes integration harder is different coding standard. We can’t just accept everything that is pointed it to us when they lacks of evidence why. But I understand why they have to point it too. With this kind of matter, there should be an expert at your side to help you with troubleshooting and balancing the issues. If it’s us, or them. It’s still the developer that could give you 100% dedication and time than us(support) when the subject is outside the scope. X theme is customisable, the only limit is the capability of the one that is customising it.

    About the title, here is the template responsible for that.

    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_META.PHP
    // -----------------------------------------------------------------------------
    // Outputs meta data into the <head> of the site.
    // =============================================================================
    
    ?>
    
    <meta charset="<?php bloginfo( 'charset' ); ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php wp_title( '' ); ?></title>
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">

    As you can see, there is no restriction added at wp_title( '' ); by us. We don’t have any idea how plugin or custom coding handles this wp_title(). We just made it available to follow wordpress standard, with no additional or lacking feature.

    But, I don’t think 404 issues is related to the title. Because, title, just like content, are final output of current page’s query. 404 happens when it can’t find what it’s looking for during the query.

    Example,

    Select * from wp_table where name="awesome-name"

    If data with awesome-name exist, then it will display the title. What if not? Then it will show 404 title.

    Queries are connected to query_vars, where as query_vars are connected to permalink. And permalink contains the name of the page/post that is needed for the query. If you have wrong structure, then it will cause 404. Thus sometimes, re-saving permalink at Admin > Settings > Permalinks may fix some 404 issues. But, there are also called custom permalinks, these are permalinks added by the plugin. Like event plugin you’re using just to create their own preferred url structure.

    I worked with permalinks before as developer, and it’s not an easy task. And something like this should be done by a developer, because any mistake could break your site. I’m sorry if I can’t help you, this something that could take long that we couldn’t support. That’s based from my experience as developer too.

    I’m not pointing you to event plugin developer, but this is not really related to theme’s functionality.

    Thanks for understanding.

    #329772

    bo-oz
    Participant

    Was anyone able to come up with a working solution? I’m trying to integrate this plugin as well.

    #330455

    Christian
    Moderator

    Hey there,

    Apparently, no. Third party integration is beyond the scope of our support as that would require working closely with a web developer. You might want to contact our trusted partners who caters X setup and customization needs. Please see https://theme.co/x/member/custom-development/.

    Thank you for understanding.

    #330799

    bo-oz
    Participant

    So, I found that somehow the global $post is (still?) empty in the X-theme breadcrumbs function when accessing The Event Calender (TEC) pages. Could this be caused by the breadcrumbs logic loading before TEC loading it’s content? This would explain why it’s still empty I cannot determine post_type.

    Any thoughts on this? TEC say their plugin does follow WP conventions.

    How can I ‘delay’ the breadcrumb funtion? I cannot find where it’s hooked into WordPress (which file do you use for hooking?).

    Thanks!