Issue w Sensei courses and lessons displaying in X theme by Theme.co

RE my website: http://ocwebseo.com/

I'm using Sensei by Woothemes and the X theme by Theme.co. I don't know php very well at all.

Problem: Courses and Lessons are not displaying correctly in the X theme. It's like they are outside the container or something. There is a Senseii tutorial on theming here: http://docs.woothemes.com/document/sensei-theming/

It appears that I have to create a sensei/wrappers folder under the X theme folder and then edit wrapper-start.php and wrapper-end.php. My problem is that I can't figure out what the content div wrapper names are for the X theme. if you read the instructions and look at these two files I bet you can figure it out really fast.

  • Patrick

    Hi there @Jeff

    Welcome to the forums, glad to have you aboard!

    Basically, what you need to do is create a folder called sensei in the root of your theme. Then create another folder inside that one called wrappers

    Then copy the wrappers-start.php and wrappers-end.php files from the plugin to the new wrappers folder you just added in your theme.

    After that, you'll need to edit the wrapper-start.php and wrapper-end.php files in your theme so that the HTML structure is the same as in the existing single.php template of your theme.

    Based on the example given for the Canvas theme, what you'll actually be adding to the wrapper templates would be something like this (for the wrapper-start.php):

    // IF X-Theme
    	case 'x' :
    	echo '<div class="x-container-fluid max width offset cf"><div class="x-main left" role="main">';
    	break;

    You would then similarly adapt the edit suggested for wrapper-end.php in your theme based on the guidelines they give for Canvas.

    This is not really beginner PHP stuff, so you may want to consider posting a job to our jobs board to get competent help for this so your site doesn't go kaflooey!
    https://premium.wpmudev.org/wordpress-development/

  • Jeff

    Hi Patrick, RE ocwbeseo.com: Oh it's so close! I pasted in your code into wrappers-start.php and I also updated the wrappers-end.php file. Not sure if I did it right. You can see the updated files at https://drive.google.com/drive/#folders/0B-j2I8WGp-vxTkRpR0pqMUFvMms

    If you could just glance at them to see if I did anything obviously stupid. If not, I guess I'll take your suggestion and hire a guy to get it over the finish line :slight_smile:

  • Jeff

    Hi Patrick, RE ocwbeseo.com: Oh it's so close! The course and lesson content is aligning correctly but it doesnt have the white background. I think it just needs a few more tweaks. I pasted in your code into wrappers-start.php and I also updated the wrappers-end.php file. Not sure if I did it right. You can see the updated files at https://drive.google.com/drive/#folders/0B-j2I8WGp-vxTkRpR0pqMUFvMms

    If you could just glance at them to see if I did anything obviously stupid. If not, I guess I'll take your suggestion and hire a guy to get it over the finish line :slight_smile: thanks for all your help.

  • Patrick

    Hi again @Jeff

    Ooh, that is darned close, isn't it?

    Looks like it might just need a bit of tweaking, so let's see if we can save you a few bucks and try to get this sorted out together, shall we?

    To get it done, it would really help if I could see both your single.php and single-course.php templates.

    Would you mind posting those too to either your Drive or pastebin.com so I can see the full HTML structure in them?

  • Jeff

    Hi Patrick, cool, thanks for hanging in there with me. I uploaded the x theme single.php; and also the single-course and single-lesson folders and single-course.php, single-lesson.php and single-quiz.php from the Sensei plugin. I'm happy to give you admin rights to my site and/or ftp login creds if that would be useful to you? the files are located on my google drive here: https://drive.google.com/drive/#folders/0B-j2I8WGp-vxTkRpR0pqMUFvMms

    Thanks! - Jeff

  • Patrick

    @Jeff

    Admin & FTP access may come in handy if the following tweak doesn't work. :slight_smile:

    There is a div container missing in our template that is the one that actually gets the styles we want (background, box-shadow, etc). So let's first try to get that in there, and get the sidebar to display.

    Please change the code you previously added to the wrapper-start.php & wrapper-end.php in your theme to this:

    wrapper-start...

    // IF X-Theme
    case 'x' :
             echo '<div class="x-container-fluid max width offset cf"><div class="x-main left" role="main"><div class="entry-wrap">';
             break;

    wrapper-end

    //IF x
    case 'x' :
    ?>
    			</div><!-- /entry-wrap -->
    		</div><!-- /x-main -->
    
    <?php do_action( 'sensei_sidebar' ); ?>
    
    <?php get_footer(); ?>
    
    	</div><!-- /x-container-fluid -->
    	<?php
    	break;

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.