Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up the front page slider #51

Closed
mkoller opened this issue Aug 12, 2016 · 4 comments
Closed

Setting up the front page slider #51

mkoller opened this issue Aug 12, 2016 · 4 comments

Comments

@mkoller
Copy link

mkoller commented Aug 12, 2016

I've done the following

  • Click on Appearance → Widgets.
  • Add two, or more, widgets of any kind to widget area “Hero”.
  • That’s it.

Added some text boxes to the hero slider widget
screen shot 2016-08-12 at 10 28 20 am

Set a new page called home to the front page.
screen shot 2016-08-12 at 10 30 13 am

But I'm not getting a slider on the front page, there are no console errors.
screen shot 2016-08-12 at 10 30 53 am

npm install bower install gulp copy-assets and browserync all work flawlessly, anything I'm missing?

Edit do I manually have to add the slider to a page template?

 <div class="wrapper" id="wrapper-hero">
 <div class="owl-carousel">
 <?php dynamic_sidebar( 'hero' ); ?>
 </div><!-- .owl-carousel -->
</div><!-- #wrapper-hero --> 
@holger1411
Copy link
Contributor

Hi!
The problem in your case might by line 17 in index.php (https://github.com/holger1411/understrap/blob/master/index.php#L17), which looks like:

if ( is_front_page() && is_home() ) {
It checks if it is the front page and the homepage.
The "is_front_page" checks if it is the blog page where all the articles will appear.
If you set a static page as homepage te slider will disappear, because it is still the homepage but not the front_page (in the WP terminology) anymore.
It was one of the coding standards requested by the WP Theme review team during the submission process for adding UnderStrap to the wordpress.org theme repository.

But you should be able to change it in your case just to:
if ( is_home() ){
Than the slider should appear even if the frontpage is a static page.

@2pixels
Copy link

2pixels commented Jan 31, 2018

Hi, I have the same issue with the hero slider. The hero widget doesn't appear on my static homepage.
Here is how you can fix it:
Copy these lines to page.php to the same place as index.php
if ( is_front_page() && is_home() ) : get_template_part( 'global-templates/hero' ); endif;

@brevelles
Copy link

For me the solution was to add if ( is_front_page() ) to the page.php file.

@dewolfe001
Copy link

Wow. This works like a charm! I keep tripping over aspects of the my work where I say, "I'm going to have to do a lot of coding and configurations..." -- only to find it's already built into Understrap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants