Static main page doesn't display

Ask Theme Error & Bug Related Issues Here

Moderator: forum_m

Post Reply
pakuula
Posts: 4
Joined: September 12th, 2015, 8:27 pm

Static main page doesn't display

Post by pakuula » September 12th, 2015, 9:38 pm

Hi!

Here is a fresh installation of WP 4.3 and Weblizar Premium: http://science2industry.ru/
The settings are to display a static page -- the preinstalled sample page of Wordpress.

When WP preinstalled themes are active, the static page is fine: the main page of the site is just the Sample page. But when Weblizar is active, it shows recent posts and completely ignores the main page settings. How to force the theme to show the static main page?

Thank you!

pakuula
Posts: 4
Joined: September 12th, 2015, 8:27 pm

Re: Static main page doesn't display

Post by pakuula » September 13th, 2015, 12:05 am

Never mind, I fixed that.

To show the static page on the home screen I created a child theme and overloaded front-page.php
In the original front-page.php there is a loop over page blocks. I modified how 'blog' block is handled.

Was:

Code: Select all

                       case 'blog':
                        //****** get index  client  ********
                        get_template_part('index', 'blog');
                        break;

became:

Code: Select all

                       case 'blog':
                        //****** get index  client  ********
                        if ('posts' == get_option( 'show_on_front' )) {
                            get_template_part('index', 'blog');
                        } else {
                            get_template_part('index', 'page');
                        }
                        break;
The newly-created template index-page.php just prints out the content of the static page. It does what I need.

User avatar
admin
Site Admin
Posts: 2880
Joined: June 5th, 2014, 1:03 am

Re: Static main page doesn't display

Post by admin » September 14th, 2015, 11:19 am

@ pakuula :

In our Theme Is generates the frontpage from the

Code: Select all

front-page.php 
. That's why It shows THEMES CUSTOMIZED HOME PAGE in each case.

Thanks..

Post Reply

Return to “Theme Problem, Error & Bug”