Support Forums for LiveMesh Themes & Plugins › Forums › Invent Theme Support › Widgets added to Courses Sidebar not appearing
- This topic has 9 replies, 3 voices, and was last updated 10 years ago by
Raghavendra.
-
AuthorPosts
-
January 22, 2015 at 7:31 am #11893
sgglinks
MemberI’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.
January 22, 2015 at 11:02 am #11902Raghavendra
ModeratorThe 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')) {
January 22, 2015 at 4:50 pm #11907sgglinks
MemberI’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.
January 24, 2015 at 9:40 am #11960Raghavendra
ModeratorTo 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.
February 3, 2015 at 1:51 pm #12129sgglinks
MemberSorry 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.
February 4, 2015 at 1:42 pm #12150Veena
ModeratorPls 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.February 11, 2015 at 6:26 am #12262sgglinks
MemberNothing 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(); ?>February 12, 2015 at 2:08 pm #12284Raghavendra
ModeratorI am testing couple of code changes that should work well for you. Will get back to you in next few hours.
February 12, 2015 at 2:19 pm #12286sgglinks
MemberThank you, guys. I appreciate any help that is given.
February 13, 2015 at 3:32 am #12295Raghavendra
ModeratorYou 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.
-
AuthorPosts
- The forum ‘Invent Theme Support’ is closed to new topics and replies.