Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1027984
    Dagaloni
    Participant

    Hi,

    Is it possible to use the page title of the Woocommerce shop as title instead of the shop title in Customizer? I would like to translate the page title and I can’t find a solution to do that.

    #1028118
    Joao
    Moderator

    Hi There,

    Thanks for writing in! Regretfully, at this time I am not entirely certain what it is you would like to accomplish based on the information given in your post. If you wouldn’t mind providing us with a little more clarification on what it is you’re wanting to do (a link to a similar example site would be very helpful, or perhaps some screenshots), we’ll be happy to provide you with a response once we have a better understanding of the situation.

    Also in order to assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    Regarding translation of X you can have a look at this article:

    https://community.theme.co/kb/translation/

    Let us know the information above mentioned and we will be happy to assist you.

    Thanks

    Joao

    #1030678
    Dagaloni
    Participant

    Hi, thanks for the reply. I’m sorry for the little information I shared.

    I would like to translate the WooCommerce shop title. Right now I can change the shop title in Customizer > Renew > Shop title. (see screenshot 3)

    I can’t translate that part of X Theme (haven’t found a way to do it yet). So I thought maybe it’s an idea to use the title of the actual woocommerce page (wp menu > pages > shop). (see screenshot 1)

    Is there a way to use the title of the actual Woocommerce shop page, instead of the shop title in the customizer?

    The url is http://padma.sanopharm.com but it’s currently ‘under construction’. I provide the login in the next post.

    Thanks!

    #1030688
    Dagaloni
    Participant
    This reply has been marked as private.
    #1031442
    Lely
    Moderator

    Hi There,

    Thank you for the credentials. That would need some adjustment on the template.
    Please copy the file _landmark-header.php from this folder: \wp-content\themes\x\framework\views\renew to this folder: \wp-content\themes\x-child\framework\views\renew.

    Replace the entire content with the following:

    
    <?php
    
    // =============================================================================
    // VIEWS/RENEW/_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 );
    $breadcrumbs        = x_get_option( 'x_breadcrumb_display' );
    
    ?>
    
    <?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 : ?>
    
        <header class="x-header-landmark">
          <div class="x-container max width">
            <div class="x-landmark-breadcrumbs-wrap">
              <div class="x-landmark">
    
              <?php if ( x_is_shop() || x_is_product() ) : ?>
    	          <?php if ( x_is_shop()) : 
    					$shop_page_id = woocommerce_get_page_id( 'shop' );
    					$page_title = get_the_title( $shop_page_id );
    			  ?>
    
                	<h1 class="h-landmark"><span><?php echo $page_title; ?></span></h1>
    	          <?php else : ?>
    	            <h1 class="h-landmark"><span><?php echo x_get_option( 'x_renew_shop_title' ); ?></span></h1>
    	          <?php endif;?>
    
              <?php elseif ( x_is_bbpress() ) : ?>
    
                <h1 class="h-landmark"><span><?php echo get_the_title(); ?></span></h1>
    
              <?php elseif ( x_is_buddypress() ) : ?>
                <?php if ( x_buddypress_is_component_with_landmark_header() ) : ?>
    
                  <h1 class="h-landmark"><span><?php echo x_buddypress_get_the_title(); ?></span></h1>
    
                <?php endif; ?>
              <?php elseif ( is_page() ) : ?>
    
                <h1 class="h-landmark entry-title"><span><?php the_title(); ?></span></h1>
    
              <?php elseif ( is_home() || is_single() ) : ?>
                <?php if ( x_is_portfolio_item() ) : ?>
    
                  <h1 class="h-landmark"><span><?php echo x_get_parent_portfolio_title(); ?></span></h1>
    
                <?php else : ?>
    
                  <h1 class="h-landmark"><span><?php echo x_get_option( 'x_renew_blog_title' ); ?></span></h1>
    
                <?php endif; ?>
              <?php elseif ( is_search() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?></span></h1>
    
              <?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__' );
    
                ?>
    
                <h1 class="h-landmark"><span><?php echo $title; ?></span></h1>
    
              <?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__' );
    
                ?>
    
                <h1 class="h-landmark"><span><?php echo $title ?></span></h1>
    
              <?php elseif ( is_404() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Oops!', '__x__' ); ?></span></h1>
    
              <?php elseif ( is_year() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Post Archive by Year', '__x__' ); ?></span></h1>
    
              <?php elseif ( is_month() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Post Archive by Month', '__x__' ); ?></span></h1>
    
              <?php elseif ( is_day() ) : ?>
    
                <h1 class="h-landmark"><span><?php _e( 'Post Archive by Day', '__x__' ); ?></span></h1>
    
              <?php elseif ( x_is_portfolio() ) : ?>
    
                <h1 class="h-landmark"><span><?php the_title(); ?></span></h1>
    
              <?php endif; ?>
    
              </div>
    
              <?php if ( $breadcrumbs == '1' ) : ?>
                <?php if ( ! is_front_page() && ! x_is_portfolio() ) : ?>
                  <div class="x-breadcrumbs-wrap">
                    <?php x_breadcrumbs(); ?>
                  </div>
                <?php endif; ?>
              <?php endif; ?>
    
              <?php if ( x_is_portfolio() ) : ?>
                <div class="x-breadcrumbs-wrap">
                  <?php x_portfolio_filters(); ?>
                </div>
              <?php endif; ?>
    
            </div>
          </div>
        </header>
    
      <?php endif; ?>
    <?php endif; ?>

    This is the part from above code where we call shop page title:

              <?php if ( x_is_shop() || x_is_product() ) : ?>
    	          <?php if ( x_is_shop()) : 
    					$shop_page_id = woocommerce_get_page_id( 'shop' );
    					$page_title = get_the_title( $shop_page_id );
    			  ?>
    
                	<h1 class="h-landmark"><span><?php echo $page_title; ?></span></h1>
    	          <?php else : ?>
    	            <h1 class="h-landmark"><span><?php echo x_get_option( 'x_renew_shop_title' ); ?></span></h1>
    	          <?php endif;?>
    
    

    Hope this helps.

    #1038220
    Dagaloni
    Participant

    Oh yeah! Thank you so much for the solution! You made my day 🙂

    #1038323
    Thai
    Moderator

    You’re most welcome 🙂

    If you need anything else please let us know.

  • <script> jQuery(function($){ $("#no-reply-1027984 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>