Widgets added to Courses Sidebar not appearing

Support Forums for LiveMesh Themes & Plugins Forums Invent Theme Support Widgets added to Courses Sidebar not appearing

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #11893
    sgglinks
    Member

    I’m trying to add widgets to the sidebar for individual courses and they are not appearing. On individual courses pages, only the “course information” is appearing on the sidebar. I’ve tried many widgets like the Search widget, the included Contact Info Widget, to simple text boxes, and they do not appear.

    This problem is only happening to courses pages.

    #11902
    Raghavendra
    Moderator

    The courses sidebar is for only archive pages and not the individual course page (enabled via theme settings panel). If you need sidebar for individual courses, pls modify the single-course.php file and add

    
    

    at line number 188.

    If you need to use course sidebar for single course, also modify the file framework/presentation/layout-manager.php at line number 183 –

                elseif (is_page_template('template-course.php') || is_page_template('template-course-filterable.php') || is_post_type_archive('course') || is_tax('course_category') || is_singular('course')) {
    
    
    #11907
    sgglinks
    Member

    I’ve done both, but there seems to be no effect. In fact, I noticed that there was no sidebar on the course archive pages as well – even before I made these code changes. (I enabled sidebar in theme options already)

    Here’s what I did

    1) I copied the single-course.php and framework/presentation/layout-manager.php to the child theme
    2) I made the code changes where you specified. the first code you mentioned should not be at line 188.. that would place it AFTER the footer. so i placed that line of code before the get_footer line.
    3) I also replaced the existing code on the layout-manager with the codes you recommended. At line 183. I’ve included a picture.

    What am i doing wrong? There are still no sidebars widgets on individual courses pages and courses archives.

    #11960
    Raghavendra
    Moderator

    To answer your queries –

    1) Pls try to change the actual file framework/presentation/layout-manager.php once and check if things work – we can move the change later to the child theme. Since layout-manager.php is not a template file, you will not be able to just copy it to the child theme and make it work. You will need to override the class as in this example –

    include_once(get_template_directory() . '/framework/presentation/layout-manager.php');
    class MO_Custom_Layout_Manager extends MO_LayoutManager {
    
        function overridden_function() {
    
            if (is_page_template('template-full-width.php')
                || $this->is_showcase_full_width_page()
                || is_page_template('template-home.php')
                || is_page_template('template-single-page-site.php')
                || is_page_template('template-archives.php')
                || is_page_template('template-sitemap.php')
                || is_page_template('template-1c.php')
            )
                return true;
    
            return false;
        }
    
    }
    
    if (!function_exists('mo_get_layout_manager')) {
        function mo_get_layout_manager() {
    
            $layout_manager = MO_Custom_Layout_Manager::getInstance();
            return $layout_manager;
        }
    }
    

    2) You are right – it should be prior to get_footer() function. Somehow in my IDE, the line number is showing as 188.

    3) Looks like you need to move the change two lines up – you are applying the change to the staff layout and not the course layout. As I said earlier, try to change in the original file first and check if everything works. You can revert later to child theme.

    #12129
    sgglinks
    Member

    Sorry for the lack of update. Problems still exist.

    I managed follow your instructions, and here are the findings.

    1) The sidebar finally appeared on Single course pages, but the sidebar is generated to the right of the ‘existing’ sidebar with the Course Information. That means there are essentially 3 columns on the page – the main content + 2 sidebars. How do I get the sidebar to appear BELOW the Course Information box?

    2) The sidebar still does not appear on Course archive pages or course category pages.

    #12150
    Veena
    Moderator

    Pls add

    < ?php get_sidebar(); ?>
    

    at line no:152 instead of adding it in line no:188 or elsewhere and see if that helps.
    And also change the course layout in Themeoptions > Site Layout tab.

    #12262
    sgglinks
    Member

    Nothing worked.

    1) I’ve already changed the site layout in Theme options and still, in course categories, no sidebar appears. I think it’s because there was no way to place widgets in course taxonomy pages in the first place? There’s no option in the Appearance > Widgets.

    2) I realized that when I select the right sidebar option in Layouts in the Theme options, it changes Single Courses to become inherently 3 columns. that means even if I found a way to get the sidebar to appear under the Course Information(course-details) widget, the entire page is squished towards the left 3/4 of the website, leaving an empty space on the right 1/4 of the page. This is not what I want. I would prefer the Single Course pages to be full width – but also having the sidebar widgets appearing right under the Course-detail widgets.

    Attached are 2 pictures of what I mean when the sidebar does not appear how I hope it would, no matter where I placed the
    < ?php get_sidebar(); ?>

    #12284
    Raghavendra
    Moderator

    I am testing couple of code changes that should work well for you. Will get back to you in next few hours.

    #12286
    sgglinks
    Member

    Thank you, guys. I appreciate any help that is given.

    #12295
    Raghavendra
    Moderator

    You can undo other changes that you may have made and I just need you to make the below changes to make it work right –

    1) Pls change the template name in line number 183 in framework/presentation/layout-manager.php to

    is_page_template('template-courses.php') || ....... // leave the rest as it is
    

    This bug will be fixed in upcoming update and hence you can safely make the change in your installation now.

    2) To loop-course.php, add

    get_sidebar();
    

    at line number 150 just above get_footer() function call. Again, this change will be in next update.

    The above two changes should help display the widgets that you drag and drop into “Courses Sidebar” widget area.

    3) To display the widgets in Courses sidebar widgets in the single course, pls change line number 149 of single-course.php file (below box-wrap comment) –

    
    

    You can replace the sidebar id with some other id if you want to keep the sidebars of archive pages and single course pages different. This code change would be custom to your installation and you may try creating a new file with the same name in your child theme to override the parent theme file.

    Hope everything works well for you now.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The forum ‘Invent Theme Support’ is closed to new topics and replies.