Home › Forums › Luzuk › Expert Carpenter › Sidebar in home page
- This topic has 3 replies, 2 voices, and was last updated 4 years, 9 months ago by User Support.
-
AuthorPosts
-
September 14, 2019 at 10:12 am #20777Heli HautalaParticipant
Hello,
Is it possible to add right sidebar to homepage template? If I use the “Page with right sidebar” template, cannot use the Slider Banner and I need it.
Tried to add following code to my child themes home-template.php file but that doesn’t do the trick.Br, Heli
<?php /** * Template Name: Home Page * * @package Luzuk */ get_header(); // echo 'dfajsdlfjlajsdlfjla'; $lz_fitness_home_sections = lz_fitness_home_section(); // print_r($lz_fitness_home_sections); foreach ($lz_fitness_home_sections as $lz_fitness_home_section) { // echo 'lz_fitness_home_section-> '. $lz_fitness_home_section; get_template_part( 'template-parts/section', $lz_fitness_home_section ); } ?> <div class="col-md-3"> <?php get_sidebar(); ?> </div> <div class="clearfix"></div> <?php get_footer(); ?>
September 16, 2019 at 7:37 am #20871User SupportParticipantHello heli
You almost got it. You will need to keep the sidebar and the sections in two columns but you added only one as col-md-3 for side bar, also they need to be inside a row. doing this might change the look of your home page and also might disturb the styles of it as far as the responsiveness is concerned it might get disturbed too. but if you really wanna do it then please check the code below we did some changes in your given code you will get the idea.get_header();
<div class=”row”>
<div class=”col-md-9″>
// echo ‘dfajsdlfjlajsdlfjla’;
$lz_fitness_home_sections = lz_fitness_home_section();
// print_r($lz_fitness_home_sections);
foreach ($lz_fitness_home_sections as $lz_fitness_home_section) {
// echo ‘lz_fitness_home_section-> ‘. $lz_fitness_home_section;
get_template_part( ‘template-parts/section’, $lz_fitness_home_section );
}?>
</div>
<div class=”col-md-3″>
<?php get_sidebar(); ?>
</div>
</div>
<div class=”clearfix”></div><?php get_footer(); ?>
Thank you
September 16, 2019 at 8:24 am #20873Heli HautalaParticipantOk, thank you very much for your help 🙂
I´ll give it a try and check the responsiveness.br,
HeliSeptember 17, 2019 at 5:39 am #20903User SupportParticipantHello Heli
Thank you for contacting us. -
AuthorPosts
- You must be logged in to reply to this topic.