Error - updating to X theme v10

Hello
we use
X theme 9.1.4
WordPress 6.1.3
Woocommerce 7.2.0
php 7.4


The issue: when we upgrade to X v10, we get errors.

We upgraded to Wordpress 6.2 and woocommerce 7.8 and nothing else active but Cornerstone.
When we updated to X theme v10 and the latest Cornerstone, the theme builder gave an error.

Pages also do not show up but give 503 errors ( on the front).
We upgraded php to 8.0, but that gave no solution.

  • when X theme was disabled, issue disappeared (with WP default theme).
  • plugins were disabled except for Cornerstone, issue persisted.

Hello @pixar24,

Thanks for posting in! Before updating the main site, it is best that you create a staging site first and do the updates there. Before making any changes to your WordPress site, it’s recommended to create a backup and test the changes on a staging site. This will help you avoid any unexpected issues or errors. Kindly check out this documentation to know how you can set up a staging site:

After updating the site, if the issue persists, kindly check this out:

And the rest of the most common issues here:

If nothing is helping, we would love to check the staging site and investigate the issue further. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.

Hello, the staging site has been setup.
See details in the secure note.

Hello @pixar24,

I went ahead and updated the theme and it seems that it is working fine on the staging server. I would suggest you please clear your browser cache and then recheck it again.

Thanks

Hi,

There seems to be a problem with the woocommerce shop (at link https://app-6300b192c1ac188968e6d5bd.closte.com/webwinkel/ )

With all plugins deactivated, still a fatal error message showing.

Thanks again for your help.

Hey @pixar24,

Thanks for reaching out!

The function x_breadcrumbs in your child theme is causing the issue of the fatal error in your WooCommerce shop page. I highly suggest that you remove that custom functionality because it was already added in the latest release.

Hope that helps.

Hi,

Thanks! Just checked and as you removed the code it seems to fix the fatal error.

  1. In the category pages we still receive php warning notice, see image.

  2. There were a few customizations we wanted over the breadcrumbs when you provded us with the php code in questions to add. That’s why we didn’t use yoast breadcrumb but the theme.
    We will want again to be able to modify it to show in the following way:

  • On the single product have the category in the breadcrumb, as shown on the image
  • On the right have the back to previous page button

Hello @pixar24,

You will NEED to update the template file overrides in your child theme, particularly the _landmark-header.php files. The updated code from the latest version is:

<?php

// =============================================================================
// VIEWS/ETHOS/_LANDMARK-HEADER.PHP
// -----------------------------------------------------------------------------
// Handles content output of large headers for key pages such as the blog or
// search results.
// =============================================================================

$disable_page_title = get_post_meta( get_the_ID(), '_x_entry_disable_page_title', true );

?>

<?php if ( ! x_is_blank( 1 ) && ! x_is_blank( 2 ) && ! x_is_blank( 4 ) && ! x_is_blank( 5 ) ) : ?>
  <?php if ( is_page() && $disable_page_title == 'on' ) : ?>
  <?php else : ?>

    <?php if ( ( x_is_shop() || x_is_product() ) && ! empty( x_get_option( 'x_ethos_shop_title' ) ) ) : ?>

      <header class="x-header-landmark x-container max width">
        <h1 class="h-landmark"><span><?php echo x_get_option( 'x_ethos_shop_title' ); ?></span></h1>
      </header>

    <?php elseif ( x_is_bbpress() ) : ?>

      <header class="x-header-landmark x-container max width">
        <h1 class="h-landmark"><span><?php echo get_the_title(); ?></span></h1>
      </header>

    <?php elseif ( x_is_buddypress() ) : ?>
      <?php if ( x_buddypress_is_component_with_landmark_header() ) : ?>

        <header class="x-header-landmark x-container max width">
          <h1 class="h-landmark"><span><?php echo x_buddypress_get_the_title(); ?></span></h1>
        </header>

      <?php endif; ?>
    <?php elseif ( is_page() ) : ?>

      <header class="x-header-landmark x-container max width">
        <h1 class="h-landmark entry-title"><span><?php the_title(); ?></span></h1>
      </header>

    <?php elseif ( x_is_portfolio_item() ) : ?>

      <header class="x-header-landmark x-container max width">
        <h1 class="h-landmark"><span><?php the_title(); ?></span></h1>
      </header>

    <?php elseif ( is_search() ) : ?>

      <header class="x-header-landmark x-container max width">
        <h1 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?></span></h1>
      </header>

    <?php elseif ( is_category() || x_is_portfolio_category() || x_is_product_category() ) : ?>

      <?php

      $meta  = x_get_taxonomy_meta();
      $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Category Archive', '__x__' );

      ?>

      <header class="x-header-landmark x-container max width">
        <h1 class="h-landmark"><span><?php echo $title; ?></span></h1>
      </header>

    <?php elseif ( is_tag() || x_is_portfolio_tag() || x_is_product_tag() ) : ?>

      <?php

      $meta  = x_get_taxonomy_meta();
      $title = ( $meta['archive-title'] != '' ) ? $meta['archive-title'] : __( 'Tag Archive', '__x__' );

      ?>

      <header class="x-header-landmark x-container max width">
        <h1 class="h-landmark"><span><?php echo $title ?></span></h1>
      </header>

    <?php elseif ( is_404() ) : ?>

      <header class="x-header-landmark x-container max width">
        <h1 class="h-landmark"><span><?php _e( 'Oops!', '__x__' ); ?></span></h1>
      </header>

    <?php elseif ( is_year() ) : ?>

      <header class="x-header-landmark x-container max width">
        <h1 class="h-landmark"><span><?php _e( 'Post Archive by Year', '__x__' ); ?></span></h1>
      </header>

    <?php elseif ( is_month() ) : ?>

      <header class="x-header-landmark x-container max width">
        <h1 class="h-landmark"><span><?php _e( 'Post Archive by Month', '__x__' ); ?></span></h1>
      </header>

    <?php elseif ( is_day() ) : ?>

      <header class="x-header-landmark x-container max width">
        <h1 class="h-landmark"><span><?php _e( 'Post Archive by Day', '__x__' ); ?></span></h1>
      </header>

    <?php elseif ( x_is_portfolio() ) : ?>

      <header class="x-header-landmark x-container max width">
        <h1 class="h-landmark"><span><?php echo x_get_option( 'x_portfolio_title' ); ?></span></h1>
      </header>

    <?php endif; ?>

  <?php endif; ?>
<?php endif; ?>

And this file must be relocated from being in /public_html/wp-content/themes/x-child/framework/views/ethos/_landmark-header.php to the new location which is the /public_html/wp-content/themes/x-child/framework/legacy/cranium/headers/views/ethos/_landmark-header.php. You may need to create the directories as this does not exist in your current child theme.

If you have made some customizations in your child theme, be advised that custom coding is beyond the scope of our support under our Support Policy. If you are unfamiliar with code and resolving potential conflicts, you may select our One service for further assistance.

Best Regards.

Thanks again, this solved problem 1. mentioned above.

What about the second issue regarding breadcrumbs? You have comment outed a big portion of code for x_breadcrumbs()

in the theme functions php to make woocommerce pages work again, but we used this code (provided by you) in order to control the two things I explained above.

Hello @pixar24,

The Commented Lines seem to be in your child theme’s functions.php file. Can you please switch to the parent theme or uncomment the lines in your child theme’s functions.php file.

// 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 ( $term_ids = get_ancestors( get_queried_object_id(), 'product_cat', 'taxonomy' ) ) {
//     $crumbs = [];

//     foreach ( $term_ids as $term_id ) {
//         $term = get_term( $term_id, 'product_cat' );

//         if ( $term && ! is_wp_error( $term ) ) {
//             $crumbs[] = sprintf( '<a href="%s">%s</a>', esc_url( get_term_link( $term ) ), esc_html( $term->name ) );
//         }
//     }

//     echo $shop_link . $delimiter . implode( ' > ', array_reverse( $crumbs ) ) . $delimiter . single_cat_title( '', false ) . $current_after;
// 	echo "<div class='cat-prod-link-back' style='float:right;'><a href='#' onClick='history.go(-1); return false;'>← Terug naar de vorige pagina</a></div>";
// }
//         elseif ( $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 ) {

//             $f_category = get_the_category();

//             if ( $f_category[0]->parent != 0 ) {
//                $f_category_id = $f_category[0]->parent;
//                $f_category_name = get_cat_name( $f_category_id );
//             } else {
//                $f_category_id = $f_category[0]->term_id;
//                $f_category_name = $f_category[0]->name;
//             }

//             echo '<a href="' . get_category_link( $f_category_id ) . '">' . $f_category_name . '</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 ( $v = get_breadcrumb_category('portfolio-category') ) {
//           $portfolio_category = $delimiter . $v;
//         } else {
//           $portfolio_category = '';
//         }

//         if ( $is_ltr ) {
//           echo '<a href="' . $link . '">' . $title . '</a>' . $portfolio_category . $delimiter . $current_before . $page_title . $current_after;
//         } else {
//           echo $current_before . $page_title . $current_after . $portfolio_category . $delimiter . '<a href="' . $link . '">' . $title . '</a>';
//         }

//       } elseif ( x_is_product() ) {

//        if ( $v = get_breadcrumb_category('product_cat') ) {
//          $product_category = $delimiter . $v;
//        } else {
//          $product_category = '';
//        }

//         if ( $is_ltr ) {
//           echo $shop_link . $product_category . $delimiter . $current_before . $page_title . $current_after;
// 		  echo "<div class='cat-prod-link-back' style='float:right;'><a href='#' onClick='history.go(-1); return false;'>← Terug naar de vorige pagina</a></div>";
//         } else {
//           echo $current_before . $page_title . $current_after . $product_category . $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>';

//   }

// }

Kindly let us know how it goes.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.