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

    Christopher
    Moderator

    Hi Sarah

    You need to do the same as it said in link above :

    Now duplicate your functions_old.php and name it back to functions.php. Then remove all the code inside

    if ( ! function_exists( 'x_get_content_layout' ) ) :
      function x_get_content_layout() {
    
        $stack          = x_get_stack();
        $content_layout = x_get_option( 'x_' . $stack . '_layout_content', 'content-sidebar' );
    
        if ( $content_layout != 'full-width' ) {
          if ( is_home() ) {
            $opt    = x_get_option( 'x_blog_layout', 'sidebar' );
            $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
          } elseif ( is_singular( 'post' ) ) {
            $meta   = get_post_meta( get_the_ID(), '_x_post_layout', true );
            $layout = ( $meta == 'on' ) ? 'full-width' : $content_layout;
          } elseif ( x_is_portfolio_item() ) {
            $layout = 'full-width';
          } elseif ( x_is_portfolio() ) {
            $meta   = get_post_meta( get_the_ID(), '_x_portfolio_layout', true );
            $layout = ( $meta == 'sidebar' ) ? $content_layout : $meta;
          } elseif ( is_archive() ) {
            if ( x_is_shop() || x_is_product_category() || x_is_product_tag() || x_is_product() ) {
              $opt    = x_get_option( 'x_woocommerce_shop_layout_content', 'sidebar' );
              $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            } else {
              $opt    = x_get_option( 'x_archive_layout', 'sidebar' );
              $layout = ( $opt == 'sidebar' ) ? $content_layout : $opt;
            }
          } elseif ( is_404() ) {
            $layout = 'full-width';
          } else {
            $layout = $content_layout;
          }
        } else {
          $layout = $content_layout;
        }
    
        if ( is_page_template( 'template-layout-content-sidebar.php' ) ) {
            $layout = 'content-sidebar';
          } elseif ( is_page_template( 'template-layout-sidebar-content.php' ) ) {
            $layout = 'sidebar-content';
          } elseif ( is_page_template( 'template-layout-full-width.php' ) ) {
            $layout = 'full-width';
        }
    
        return $layout;
    
      }
      add_action( 'customize_save', 'x_get_content_layout' );
    endif;
    
    add_filter('theme_mod_x_stack', function($val){ return x_get_option( 'x_stack' ); });
    add_filter('theme_mod_x_integrity_design', function($val){ return x_get_option( 'x_integrity_design' ); });
    
    add_filter( 'ups_sidebar', function ( $default_sidebar ) {
    
      $sidebars = get_option( 'ups_sidebars' );
    
      foreach ( $sidebars as $id => $sidebar ) {
        if (  x_is_shop() || x_is_product_category() || x_is_product_tag() || x_is_product() ) {
          if ( array_key_exists( 'index-shop', $sidebar ) && $sidebar['index-shop'] == 'on' ) {
            return $id;
          }
        }
      }
    
      return $default_sidebar;
    
    }, 9999 );

    Hope it helps.

    #85200

    Sarah E
    Participant

    Hi, yes i did that immediately as i said in the next post. I gained instant access to the customizer but still have sidebar issues and the qty counter has returned to the store.

    #85201

    Mrinal
    Member

    Hey Sarah,

    I can’t see functions.php file in your Renew Child theme:

    #85202

    Sarah E
    Participant

    ok, that’s really weird because it was absolutely definitely there earlier. Never mind, it’s there now!

    #85204

    Christopher
    Moderator

    Glad it works now.
    if there is any other problem let us know.

    Thank you.

    #85209

    Sarah E
    Participant

    thanks. well i still have the original problem that i asked about in #84190. This thread starts with instructions to another user, to install the topbar. I was asking for help as I can’t seem to make that work and when i paste in the code as per the first 2-3 posts in this thread it doesn’t work for me. Just tried it again now and can’t get into customizer all over again so i’ve deleted it out again from functions.php.

    So as well as getting the topbar showing, i was asking for it to be without social icons and with the cart widget and a login (username/password fields) if possible.

    The qty on my shop shouldn’t be there either.

    thx

    #85226

    Mrinal
    Member

    Hi Sarah,

    Check sidebar is showing in single product page:

    Added the following CSS to customizer to remove social icons:

    .x-topbar .x-social-global {
        display: none;
    }

    Then added the following codes into functions.php to show Top bar Menu:

    add_filter('option_x_topbar_content','x_topbar_do_shortcode');
    
    function x_topbar_do_shortcode($content) {
     return do_shortcode( $content );
    }

    Now,

    You customizer loading fine, Sidebar showing in product pages, menu showing top bar. Tell me what else do you need. I’ll be glad to assist you.

    #85228

    Sarah E
    Participant

    Oh brilliant, thanks so much.

    What i’ve really been looking for, but just can’t find, is how to put a true login panel on the top bar. Ideally fields for username and password, or, if that’s not possible then something similar to what X has on this site – login text (or buttons) that changes once youre logged in to say “hi Sarah” or “loguout”

    And can we right align topbar text and make it a little thinner height-wise?

    cheers,

    #85233

    Mrinal
    Member

    Hi Sarah,

    To adjust the height of Top bar, add the following CSS:

    .x-topbar .menu-top-bar-container {
        padding-bottom: 10px;
    }
    .x-topbar {
        text-align: right;
        max-height: 55px;
    }

    Now, to show login logout link conditionally you need to use a plugin: https://wordpress.org/plugins/baw-login-logout-menu/

    Add the login logout, menu items in Top bar menu via Appearance > Menus:

    Hope this helps, Cheers!

    #85244

    Sarah E
    Participant

    ok, thanks. I can’t get in to the customizer again – it won’t go past step 2 initializing…

    #85255

    Sarah E
    Participant

    still can’t get into the customizer but i have installed the plugin you recommended. I guess i didn’t make clear that it’s the woocommerce login/register i’m trying to get, not the wordpress one (which i hope my customers NEVER lay eyes on). I can have a basic “login” link (as per my main menu) that connects to the wc my account page but i really want to avoid the customer having to leave the page they’re on to login if possible. Or at the very least be reactive like this one is and only prompt “login” if they haven’t already…
    sorry, i know this is all getting a little complicated – and it seems so very simple!

    #85260

    Mrinal
    Member

    Hey Sarah,

    There is noting wrong with in functions.php file now that anyone can argue.

    Seems to me: If I place

    add_filter('option_x_topbar_content','x_topbar_do_shortcode');
    
    function x_topbar_do_shortcode($content) {
     return do_shortcode( $content );
    }

    the customizer won’t load perfectly, so please update all of your plugins. The above filter doesn’t occur any issue with other websites even in my local.

    #85262

    Mrinal
    Member

    Opps, then you should use WooCommerce shortcode into top bar: http://docs.woothemes.com/document/woocommerce-shortcodes/

       
        [woocommerce_edit_account] - Edit account pages
        [woocommerce_change_password] – shows the change password page
        [woocommerce_view_order] – shows the user account view order page
        [woocommerce_logout] - shows the logout page
        [woocommerce_pay] – shows the checkout pay page
        [woocommerce_thankyou] – shows the order received page
        [woocommerce_lost_password] – shows the lost password page
        [woocommerce_edit_address] – shows the user account edit address page
    
    
    #85263

    Sarah E
    Participant

    ok, thanks. done.

    #85271

    Sarah E
    Participant

    hmm, well i have “login” already on my menu that is a basic link to the woo my account page and this is what i was hoping to replace/improve upon. Can you tell me how to put a woocommerce shortcode into my top bar?