Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1134754
    wyckoffsmi
    Participant

    I am looking for a little help on displaying the sensei sidebar on xtheme integrity

    You can see my issue here http://wyckoffsmi.com/courses-overview/

    I have read through all existing documentation on the forum and woocommerce but have not had any success. Any help would be greatly appreciated currently I have modified the functions.php of my child theme with the following content.

    /**
     * Declare that your theme now supports Sensei
     */
    add_action( 'after_setup_theme', 'sensei_support' );
    function sensei_support() {
        add_theme_support( 'sensei' );
    }
    
    /**
     * Remove the default Sensei wrappers
     */
    global $woothemes_sensei;
    remove_action( 'sensei_before_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper' ), 10 );
    remove_action( 'sensei_after_main_content', array( $woothemes_sensei->frontend, 'sensei_output_content_wrapper_end' ), 10 );
    
    /**
     * Add X Theme by Themeco specific custom  Sensei content  wrappers
     */
    add_action('sensei_before_main_content', 'x_theme_sensei_wrapper_start', 10);
    add_action('sensei_after_main_content', 'x_theme_sensei_wrapper_end', 10);
    
    function x_theme_sensei_wrapper_start() {
            if ( is_singular( 'course' ) ){
                remove_action( 'woocommerce_before_single_product', 'x_woocommerce_before_single_product', 10 );
                remove_action( 'woocommerce_after_single_product', 'x_woocommerce_after_single_product', 10 );
            }
            echo '<div class="x-container max width offset">'.
                '<div class="x-main left" role="main">'
                 .'<div class="entry-wrap"> ';
    }
    
    function x_theme_sensei_wrapper_end() {
    
            echo ' </div> <!-- .entry-wrap -->'
                 . '</div> <!-- end sensei .x-main left-->';
            get_sidebar();
            echo'</div> <!-- end sensei x-container-fluid -->';
    }
    
    /**
     * remove default sensei titles
     */
    remove_action( 'sensei_course_single_title', array( $woothemes_sensei->frontend , 'sensei_single_title' ), 10 );
    remove_action( 'sensei_lesson_single_title', array( $woothemes_sensei->frontend , 'sensei_single_title' ), 10 );
    remove_action( 'sensei_quiz_single_title', array( $woothemes_sensei->frontend, 'sensei_single_title' ), 10 );
    remove_action( 'sensei_message_single_title', array( $woothemes_sensei->frontend, 'sensei_single_title' ), 10 );
    
    /**
     * Add custom theme title:
     */
    add_action( 'sensei_course_single_title', 'x_theme_sensei_single_title', 10 );
    add_action( 'sensei_lesson_single_title', 'x_theme_sensei_single_title', 10 );
    add_action( 'sensei_quiz_single_title', 'x_theme_sensei_single_title', 10 );
    add_action( 'sensei_message_single_title', 'x_theme_sensei_single_title' , 10 );
    
    function x_theme_sensei_single_title() {
        global $post;
    
        if( is_singular( 'sensei_message' ) ) {
            $content_post_id = get_post_meta( $post->ID, '_post', true );
            if( $content_post_id ) {
                $title = sprintf( __( 'Re: %1$s', 'woothemes-sensei' ), '<a href="' . get_permalink( $content_post_id ) . '">' . get_the_title( $content_post_id ) . '</a>' );
            } else {
                $title = get_the_title( $post->ID );
            }
        } else {
            $title = get_the_title();
        }
        ?>
    
        <header class="entry-header">
            <h1 class="entry-title">
                    <?php echo $title;?>
            </h1>
        </header>
        <?php
    }
    #1134939
    Christopher
    Moderator

    Hi there,

    Please provide us with login credentials so we can take a closer look, but we can’t guarantee that we’ll be able to help you with this since it’s related to third party plugin and we don’t provide support for third party plugins.

    Thanks.

    #1135560
    wyckoffsmi
    Participant
    This reply has been marked as private.
    #1136149
    Lely
    Moderator

    Hi There,

    Since you’re using a fullwidth content layout from Appearance > Customize > Layout and Design please replace this line of your code:
    get_sidebar();
    With this:

      <aside class="<?php x_sidebar_class(); ?>" role="complementary">
        <?php if ( get_option( 'ups_sidebars' ) != array() ) : ?>
          <?php dynamic_sidebar( apply_filters( 'ups_sidebar', 'sidebar-main' ) ); ?>
        <?php else : ?>
          <?php dynamic_sidebar( 'sidebar-main' ); ?>
        <?php endif; ?>
      </aside>
    

    This line get_sidebar(); will only return your sidebar if your global layout is not fullwidth or if you’re using Content Left, Sidebar Right/Sidebar Left, Content Right.

    Hope this helps.

    #1137391
    wyckoffsmi
    Participant

    Where in what file or area would I make this substition?

    #1137427
    wyckoffsmi
    Participant

    sorry posted twice

    #1137429
    wyckoffsmi
    Participant

    .please disregard this screen shot

    #1137453
    wyckoffsmi
    Participant

    The last two posts were mistakes, Where in what file or area would I make this substition? With the suggestion code above. When I add it in the functions.php in the child theme file I get a syntax error.

    #1137749
    Rad
    Moderator

    Hi there,

    Please replace this code,

    function x_theme_sensei_wrapper_end() {
    
            echo ' </div> <!-- .entry-wrap -->'
                 . '</div> <!-- end sensei .x-main left-->';
            get_sidebar();
            echo'</div> <!-- end sensei x-container-fluid -->';
    }

    with this,

    function x_theme_sensei_wrapper_end() { ?>
    
            </div> <!-- .entry-wrap -->
            </div> <!-- end sensei .x-main left-->
            
     <aside class="<?php x_sidebar_class(); ?>" role="complementary">
        <?php if ( get_option( 'ups_sidebars' ) != array() ) : ?>
          <?php dynamic_sidebar( apply_filters( 'ups_sidebar', 'sidebar-main' ) ); ?>
        <?php else : ?>
          <?php dynamic_sidebar( 'sidebar-main' ); ?>
        <?php endif; ?>
      </aside>
    
           </div> <!-- end sensei x-container-fluid -->
    <?php }

    Hope this helps.

    #1138668
    wyckoffsmi
    Participant

    I have made this changed however the layout remains the same with the side bar cut off below the main content.

    #1139071
    Rue Nel
    Moderator

    Hello There,

    Thanks for the updates! I went ahead and modified the code. The sidebar is now showing. I ended up using this code:

    function x_theme_sensei_wrapper_end() { ?>
    
            </div></div> <!-- .entry-wrap -->
            </div> <!-- end sensei .x-main left-->
            
     <aside class="<?php x_sidebar_class(); ?>" role="complementary">
        <?php if ( get_option( 'ups_sidebars' ) != array() ) : ?>
          <?php dynamic_sidebar( apply_filters( 'ups_sidebar', 'sidebar-main' ) ); ?>
        <?php else : ?>
          <?php dynamic_sidebar( 'sidebar-main' ); ?>
        <?php endif; ?>
      </aside>
    
           </div> <!-- end sensei x-container-fluid -->
    <?php }

    If you need anything else, please let us know.

    #1139290
    wyckoffsmi
    Participant

    I just want to take a second to let you know that your theme and everything is great but what separates your company from the rest is the customer service and dedication to helping your clients! You guys always go above and beyond what is required as a theme creator to help people achieve the look and the functions they are looking for. I hope this single message doesn’t get lost in the hundreds posted by you guys are great and we will continue to use and support your products because of this.

    Thanks.

    #1139298
    Rue Nel
    Moderator

    Hello There,

    You’re most welcome! We’re happy to help you out.
    If you need anything else we can help you with, don’t hesitate to open another thread.

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