Go to Site Actions => Site Settings => Look and Feel => Navigation => Current Navigation.

In the current navigation section you could see the following options

Programmatically Enable/Disable Current Navigation Settings
using (SPSite siteCollection = new SPSite("http://servername:1111/sites/sample"))
{
using (SPWeb web = siteCollection.RootWeb)
{
PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
// Current navigation
//Show Subsites
publishingWeb.Navigation.CurrentIncludeSubSites = false;
//Show Pages
publishingWeb.Navigation.CurrentIncludePages = false;
// Maximum number of dynamic items to show within this level of navigation:
publishingWeb.Navigation.CurrentDynamicChildLimit = 50;
//Update the changes
publishingWeb.Update();
}
}

Join the conversation! Your thoughts help the community grow.