Adding a sidebar.
-
I just installed the Blix theme by Sebastian Schmieg for my girlfriend, modified the CSS and added some pages. It’s viewable @ https://www.ifeelfine.nl. Now my problem is this:
In the “Sociologie” page, there are supposed to be several subpages. Now, whenever I add a page, with “Sociologie” as the parent, it automatically gets added to the main navigation. This is the Blix standard:
Additional Pages
You can set up as many pages as you like. All pages will be automatically added to the navigation. However if you’ve set up all of the above pages, additional pages will probably break the navigation unless you don’t modify the CSS to make the buttons smaller.But, I’d like to add these pages to the sidebar for “Sociology”, instead of the main navigation. In the Blix help file this is said about ‘secondary navigation’:
Secondary Navigation
In case you’ve got more pages than fit into the main navigation Blix offers a secondary navigation in the sidebar:
Make backup copies of header.php and sidebar.php
Open header.php in your text editor of choice
Look for the following code snippet
else {
(is_page($page_id))?$selected = ‘ class=”selected”‘:$selected=”;
echo “- $page_title
- $page_title
\n”;
}
and remove it
Save the modified file
Open sidebar.php
Change line 10 from * to */
Remove line 20 (<?php */ ?>)
Save the modified fileI tried this (I assumed it would add a sidebar to all the main pages), but the first problem I encountered was that there was no such snippet
else {
(is_page($page_id))?$selected = ‘ class=”selected”‘:$selected=”;
echo “\n”;
}in the header.php file.
These are the contents of the header.php file I have:
>
a€¢ >Home ID; $page_title = $page->post_title; $page_name = $page->post_name; if ($page_name == “archives”) { (is_page($page_id) || is_archive() || is_search() || is_single())?$selected = ‘ class=”selected”‘:$selected=”; echo “Archives\n”; } elseif($page_name == “about”) { (is_page($page_id))?$selected = ‘ class=”selected”‘:$selected=”; echo “About\n”; } elseif ($page_name == “contact”) { (is_page($page_id))?$selected = ‘ class=”selected”‘:$selected=”; echo “Contact\n”; } elseif ($page_name == “about_short”) {/*ignore*/} } } ?>
So I took out the last part because it resembled the snippet mostly, and edited the sidebar.php file, but after I saved and uploaded, it completely messed up my CSS.
So my question is:
(1)How do I add a sidebar to additional pages, (2) how do I add subpages to that sidebar?
Like I said, I’m using Blix by Sabastian Schmieg, @ https://www.kingcosmonaut.de/blix/
- The topic ‘Adding a sidebar.’ is closed to new replies.