resolvedTask: making the different layouts of index (Front Page) and blog pages (Posts Page), with different widgets appearing on the opposite sides of site, for the site with the static front page. Accomplishing these, allows us to have the proper site with the proper blog under one roof.
I wanted to make the Static Index Page and the Page of Posts (blog)on my site to appear differently, so that the link bar of the Static Index Page would be on the left side, including the same links as on top bar, while the page of posts would have the side bar on the right side with the typical structure of the blog, such links as categories, archives, search box and rest, without any links from the left side (they already were on top).
To achieve these, first of all, I tried to experiment with the side bar options of the Clear Line theme, but soon realized that this couldn't be done from there.
After setting the 'single post' option to two side bars on the right side, and removing one of them (left) by setting its space to 5px, I have arranged my desired widgets on it.(It is important to set 'show demo data in side bars' box from sidebars options to 'not' before). After these, navigating to the my blog page (set by me as the page of posts), from the WordPress control panel, I still saw the same left side bar (single) layout as on the Index Page, but after I proceed to click on the single post, the desired right sided layout appeared there, as I wanted it (but not on blog page). After experimenting with the different combination of the page layouts, I tried with the Widget Context plugin, but also without success; so I deactivated the plugin and all changes it made.
Because I created the Blog Page before all these experiments, I thought that this was the possible reason (because while making the new single page, we can chose the desired template options). Therefore I temporally transferred my Post Page to another blank page of my site (from Settings>Reading Settings), and deleted the blog page (it is important to delete it permanently from the trash folder, otherwise you would have a new page named as 'blog 1'). After these, I created new Blog Page, and set its layout to two right side bars (from WP Edit Page). After navigating to my newly created Blog Page, I saw that it has the layout I desired (right side bar with all widgets), but when I set it to be the Posts Page, the side bar went to the left side again, and widgets have changed accordingly. By then, I have realized that both the Index Page the Page of Posts are set up to have the same layout.
Next I have searched the Vatuma Support, and have found the page dealing with the same matter I was looking for: http://vatuma.com/support/topic/static-index-page#post-822. Your solution from there worked fine for me, but the important point was to set the index page to two right side bars first. What I mean to say is that the Page of Posts now has became the same with the Index Page (sidebar options), while the original Index Page has inherited the settings of Sidebars on Single page (sidebars options). Also it is very important to add the code properly, in line with other text, otherwise the theme could crash.
Sample how it was done:
$shortname = self::cfg('shortname');
if (is_page())
{
$id = (int) $wp_query->get_queried_object_id();
$template = get_post_meta($id, '_wp_page_template', true);
if (isset($page_templates[$template])) return $page_templates[$template];
//else
return self::getInherited($shortname.'_single_page_sidebars','');
}
if (is_home() || is_front_page() ) return self::getInherited($shortname.'_index_sidebars','');
P.S. Hey Ivan, it could be an good idea, to add separate settings for Index and Post pages in the Clear Line Theme options in future? Thank you once more, all the best, and God bless!
crama, why using page templates is not suitable for you?
You can set any of the templates for every single page (on the "Page Edit" page)
Hey Ivan, I tried to do this, I have set the 'Two right side bar' from the 'Page Edit', but after I have set up the 'Blog' page to the 'Post page'from Settings>Reading Settings of WordPress, the layout has changed to the appearance of 'index' page of side bar options of the Clear Line Theme.
1. set index layout in options (it will be set for post list page)
2. set template for your front page (at 'edit page').
They will be different.
Now I have understand. It is like solving a riddle, and I didn't thought this in such way. Actually I have cling to the idea that the Front Page of the WordPress options was set as the 'index' page in the theme options (side bar), and that this couldn't be changed Thanks for your clarification, I hope it will help others. In this way, the functionality I was suggesting to add in my post already there! This makes your Theme even more awesome!
You must log in to post.