Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1345275
    Marcodewit
    Participant

    Hello!

    I would like to ask for a little help with the container setup for Sensei within my Ethos theme setting.

    I read through all documentation and followed the guidelines Sensei setup for compatability with X.

    See below the code that I added in the functions.php of my Child theme.

    It seems to work for a large part, whereby courses give a proper container setup (see screenshot 1), but somehow the lessons have the bottom part not aligned properly (see screenshot 2).

    Can you help me?

    Thanks so much,
    Marco
    http://www.harmonycentershop.nl

    Code added to the functions.php:

    /**
     * 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
    }
    #1345712
    Rad
    Moderator

    Hi there,

    Thanks for posting in.

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials
    – URL where the integration’s procedure is given
    – URL of how should they look like

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks!

    #1345997
    Marcodewit
    Participant
    This reply has been marked as private.
    #1346006
    Marcodewit
    Participant
    This reply has been marked as private.
    #1346719
    Rad
    Moderator

    Hi Marco,

    Seems to be okay. But I’m not sure what should go for lesson page, would you mind providing a complete sample of you’re expecting to see on that page? It looks like it uses a different template, I need to confirm how it looks.

    We only provided the wrapper integration, but not the content rendered within.

    Thanks!

    #1346817
    Marcodewit
    Participant

    Hi there,

    I understand, only the lessons are still being developed by the teachers. I hope to have this soon.

    * For now I wonder why the green x-footer part underneath the lessons is squeezed. See attached screenshots. It has white area’s to the left and right of it. Do you know how I can get this full width (the same as the course page and all other pages)?

    * Also the lesson title seems to be doubled somehow in the page. Any idea how I can display this title once?

    Thanks!!

    Cheers
    Marco

    #1347200
    Rad
    Moderator

    Hi there,

    Please update your code to this

    /**
     * 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">';
    }
    
    function x_theme_sensei_wrapper_end() {
            echo '</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
    }

    Hope this helps.

    #1347738
    Marcodewit
    Participant
    This reply has been marked as private.
    #1348297
    Rad
    Moderator

    Hi there,

    I think this should do it,

    /**
     * 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() {
            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
    }

    The wrapper is doubled, the other one has no closing element.

    Hope this helps.

    #1353441
    Marcodewit
    Participant

    Yep,

    This works excellent.

    Thanks so much.

    #1353515
    Lely
    Moderator

    You’re welcome!

    Cheers!

    #1396432
    Marcodewit
    Participant

    Hi there,

    Could you please help me with some styling issues for a course page?

    1) I’m looking for a way to change the title size on a course page?

    For instance, this is one of the course pages: http://harmonycentershop.nl/cursus/gratis-cursus-haal-de-natuur-in-huis/

    2) Also, I do not want to use the sidebar on the course page, how can I make it go full-width?

    3) Same question for the lesson pages: how can I change the title size? And how to go full-width (no side-bar)?

    For instance, this is one of the sample lesson pages: http://harmonycentershop.nl/les/les-1-voorstelling/

    Thank you!

    Cheers,
    Marco

    #1396558
    Rupok
    Member

    Hi Marco,

    Although we can’t help on such customization but as you have comes so far, I’ll try to point you to achieve them.

    You can add this under Custom > CSS in the Customizer.

    .single-course header > h1, 
    .single-lesson header > h1 {
        font-size: 40px;
    }
    .single-course .x-main.left, 
    .single-lesson .x-main.left {
        width: 100%;
        padding: 0;
        float: none;
    }

    Hope this will do the job. Let’s adjust the font-size.

    Cheers!

    #1396611
    Marcodewit
    Participant

    Super!

    Thanks so much
    M

    #1396624
    Joao
    Moderator

    You are welcome 🙂

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