I am actually doing a website for my training and I chose this theme.
It’s one of the better than I could ever find but, there is always a but, I don’t know how to show my sidebar on the static page I defined as homepage.
Is someone here to help me ? I will be thankful to all of you for your help.
Have all a nice day, evening, whatever wherever you are, enjoy your day.
This theme instead of having sidebar, has it own dedicated homepage widgets that are displayed below the Page.
However, it is easy to fix this. Open front-page.php file and replace the current code with this one
<?php
if ( get_option( 'show_on_front' ) == 'posts' ) {
get_template_part( 'index' );
} elseif ( 'page' == get_option( 'show_on_front' ) ) {
get_header(); ?>
<?php dazzling_featured_slider(); ?>
<?php dazzling_call_for_action(); ?>
<div id="content" class="site-content container">
<div id="primary" class="content-area col-sm-8 col-md-8">
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-content">
<?php the_content(); ?>
<?php
wp_link_pages( array(
'before' => '<div class="page-links">' . __( 'Pages:', 'dazzling' ),
'after' => '</div>',
) );
?>
</div><!-- .entry-content -->
<?php edit_post_link( __( 'Edit', 'dazzling' ), '<footer class="entry-meta"><i class="fa fa-pencil-square-o"></i><span class="edit-link">', '</span></footer>' ); ?>
</article><!-- #post-## -->
<?php get_sidebar( 'home' ); ?>
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() ) :
comments_template();
endif;
?>
<?php endwhile; // end of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_sidebar();
get_footer();
}
?>
There is nothing much changed between original code and this one but it is so much easier to just copy/page the entire thing that trying to explain which lines you should change.
This discussion is related to Dazzling instead of Sparkling theme and they are different.
For Sparkling you just need to rename or remove front-page.php file from theme folder and you are ready to go. This won’t cause any errors or anything, it will just make sure that theme uses page.php template instead of front-page.php.
Thank for your support. I followed your instruction, but the sidebar appears on the right of Front page. And I can change it to Leftsidebar, I tried to choose Left sidebar option in Theme Option, but it not work. Is there any way to have Left Sidebar on Front Page?
Thanks for this! It worked like a charm. 2 follow-up questions: How can I get the widget sidebar to be on the left side? And is there a way to make the widget sidebar width on the homepage a different size than on the rest of the site?
How is this with the new version, as the file front-page.php doesn’t exist any more?
What do I have to do in order to have the sidebar on the right side on a static main page?
Thank you for your help.