• Resolved gamerdarling

    (@gamerdarling)


    I’m having this weird issue where I can have my front page set to the blog page or not set(and default to recent posts) but if I try to have it set to a static page no content shows up. Any ideas on what I need to change to get that working? When not set as the static home page the content on the page works fine.

    Currently developing locally, but I can push it live if someone wants to see it live.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter gamerdarling

    (@gamerdarling)

    Same result with all plugins disabled. I’m new to WP coding, but looking at the front-page.php of the theme I’m using it doesn’t seem to have anything that would display a specific pages content in it. It seems to load some widget areas if they’re active, check for layout to see if it needs columns and then load recent posts with no handling for content when a static front page is used. Is that normal? Here’s the code:

    <?php
    /**
     * Template to show the front page.
     *
     * @package ThemeGrill
     * @subpackage ColorMag
     * @since ColorMag 1.0
     */
    ?>
    
    <?php get_header(); ?>
    
       <div class="front-page-top-section clearfix">
          <div class="widget_slider_area">
             <?php
             if( is_active_sidebar( 'colormag_front_page_slider_area' ) ) {
                if ( !dynamic_sidebar( 'colormag_front_page_slider_area' ) ):
                endif;
             }
             ?>
          </div>
    
          <div class="widget_beside_slider">
             <?php
             if( is_active_sidebar( 'colormag_front_page_area_beside_slider' ) ) {
                if ( !dynamic_sidebar( 'colormag_front_page_area_beside_slider' ) ):
                endif;
             }
             ?>
          </div>
       </div>
       <div class="main-content-section clearfix">
          <div id="primary">
             <div id="content" class="clearfix">
    
             <?php
             if( is_active_sidebar( 'colormag_front_page_content_top_section' ) ) {
                if ( !dynamic_sidebar( 'colormag_front_page_content_top_section' ) ):
                endif;
             }
    
             if( is_active_sidebar( 'colormag_front_page_content_middle_left_section' ) || is_active_sidebar( 'colormag_front_page_content_middle_right_section' )) {
             ?>
                <div class="tg-one-half">
                   <?php
                   if ( !dynamic_sidebar( 'colormag_front_page_content_middle_left_section' ) ):
                   endif;
                   ?>
                </div>
                <div class="tg-one-half tg-one-half-last">
                   <?php
                   if ( !dynamic_sidebar( 'colormag_front_page_content_middle_right_section' ) ):
                   endif;
                   ?>
                </div>
             <div class="clearfix"></div>
             <?php
             }
             if( is_active_sidebar( 'colormag_front_page_content_bottom_section' ) ) {
                if ( !dynamic_sidebar( 'colormag_front_page_content_bottom_section' ) ):
                endif;
             }
             if (get_theme_mod('colormag_hide_blog_front', 0) == 0): ?>
    
                <div class="article-container">
                   <?php if ( have_posts() ) : ?>
    
                      <?php while ( have_posts() ) : the_post(); ?>
    
                         <?php
                         if ( is_front_page() && is_home() ) {
                           get_template_part( 'content', '' );
                         } elseif ( is_front_page() ) {
                           get_template_part( 'content', 'page' );
                         }
                         ?>
    
                      <?php endwhile; ?>
    
                      <?php get_template_part( 'navigation', 'none' ); ?>
    
                   <?php else : ?>
    
                      <?php get_template_part( 'no-results', 'none' ); ?>
    
                   <?php endif; ?>
                </div>
             <?php endif; ?>
             </div>
          </div>
          <?php colormag_sidebar_select(); ?>
       </div>
    
    <?php get_footer(); ?>

    I’m trying the folder renaming suggested in the other thread as well, but that file seemed suspicious to me? Thanks for linking that thread, I tried searching for stuff related to this issue, but most of the threads I found were more than seven years old. >.<

    @gamerdarling,

    What you named the above php file?

    Have you enabled debug mode? Any errors / warnings?

    Thread Starter gamerdarling

    (@gamerdarling)

    The folder renaming thing didn’t work. But it does work if I switch themes.

    I am working out of a child theme I’ve created. When I switch back to the original theme the front page works correctly, so clearly I was mistaken about it being an issue with that file…When creating a child theme is there a specific php file that you need to copy into the child theme for this to function correctly? It’s odd, because everything else seems to be working…

    Thread Starter gamerdarling

    (@gamerdarling)

    I haven’t done debug mode, I haven’t actually edited any php, just some CSS changes in the child theme. The php file up there was the front-page.php file from the parent theme. But since it works when I switch to the parent theme, I’m thinking I’m mistaken about it being the problem.

    @gamerdarling,

    If you want only CSS changes, not any php. You don’t need to copy any php files under Child theme folder.

    This may be helpful => Child Themes

    Thread Starter gamerdarling

    (@gamerdarling)

    Then I really don’t understand why I would be seeing this issue on the child theme only…Shouldn’t it be exactly the same functionality as the parent theme?

    Thread Starter gamerdarling

    (@gamerdarling)

    Yeah, I’m now leaning towards the developer having done something specifically to make it so that you don’t create child themes because they charge for an upgraded option that allows you to do things as basic as changing the footer color. Guh. I already needed to modify way more than that to make the theme be what I wanted anyway.

    That’s annoying, I wish it had just come with the tagline in the description telling me not to create a child theme. I’m happy to respect their copyright, so I’m not going to try and find a way around it, but now I’ve wasted a lot of time trying to make it work.

    @gamerdarling,

    I understand that.

    You can mark this thread as ‘Resolved’ if you don’t need any more help on this topic specifically.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Front Page Blank when Static Page’ is closed to new replies.