Page 1 of 1

Pages in Navigation Bar - Exclude option

Posted: 21 Aug 2010, 19:41
by dberebi
In the " Suffusion => Blog Features => Main Navigation Bar Setup" admin page there is an option "Pages in Navigation Bar - All or Selected". Currently you can only select "all" (show all pages ignoring selection) or "selected" (show only selected pages in the menu).

I think we should have the option "exclude" to show all pages except for the selected pages.

Why to add this feature?
If I want to exclude a page from the menu (e.g. if I use that specific page as my homepage), this way should be the most convenient. If I'll choose the "selected" option I'll have to return to here every time I'm creating a new page to select it.
My solution also suggest a more readable and optimized code than the "selected" option.

How to add this feature? Just 2 find & replace!
in "/wp-content/themes/suffusion/functions.php"
find (line 716):

Code: Select all

	if ($page_all_sel == 'selected') {
		$pages_excluded = get_excluded_pages($page_option);
	}
	else {
		$pages_excluded = array();
	}
replace with:

Code: Select all

	if ($page_all_sel == 'selected') {
		$pages_excluded = get_excluded_pages($page_option);
	}
	elseif ($page_all_sel == 'exclude') {
		global $$page_option;
		$pages_excluded = $$page_option;
	}
	else {
		$pages_excluded = array();
	}


in "/wp-content/themes/suffusion/admin/theme-options-blog-features.php"
find:

Code: Select all

		"options" => array("all" => "All, ignoring next option", "selected" => "Selections from the next option"),
replace with:

Code: Select all

		"options" => array("all" => "All, ignoring next option", "exclude" => "Exclude the pages selected in the next option", "selected" => "Selections from the next option"),
Of course while implementing this feature you would like to make some changes like to move the "global $$page_option;" upward and maybe change the language...

Re: Pages in Navigation Bar - Exclude option

Posted: 22 Aug 2010, 08:35
by Colin
This would be useful to me too should it be implemented.