Hi Mary and Gareth
I made the new modifications and now I have a second custom menu in the theme's general settings, but, unfortunately, there's still a problem. There are no errors any more but the items still appear as soon as I log in. They show up only in the home page though. In other places/pages, they do not appear. How can I get rid of them in the home page as well?
I really appreciate your taking the time to solve this problem.
By the way, to make sure I have done every thing correctly, these are the changes I made:
1. added the following to the theme's settings.php
// Theme overrides custom menu setting...
$name = 'theme_themename/custommenuitems'; //changed themename to my theme's name
$title = get_string('custommenuitems', 'admin');
$description = get_string('configcustommenuitems', 'admin');
$default = '';
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
$temp->add($setting);
2. added the following line to top of frontpage.php
$custommenu = $OUTPUT->custom_menu($PAGE->theme->settings->custommenuitems);
$hascustommenu = (empty($PAGE->layout_options['nocustommenu']) && !empty($custommenu));
3. Added only the highlighted line to theme's frontage.php
<div class="nav-collapse collapse">
<?echo $custommenu; ?>
<ul class="nav pull-right">