In this article we will discuss how to apply theme to a SharePoint site. Also check my last article on how to create a custom theme for SharePoint 2010 and how to upload custom theme to SharePoint 2010.
Below is the SharePoint 2010 object model code to apply theme to a SharePoint 2010 site.
using (SPSite site=new SPSite(“http://[Site URL]”))
{
SPWeb web=site.OpenWeb();
ThmxTheme.SetThemeUrlForWeb(web, "/_catalogs/Theme/MyCutomTheme.thmx", False);
}
Below is the SharePoint 2010 object model code to apply theme to a SharePoint 2010 site.
using (SPSite site=new SPSite(“http://[Site URL]”))
{
SPWeb web=site.OpenWeb();
ThmxTheme.SetThemeUrlForWeb(web, "/_catalogs/Theme/MyCutomTheme.thmx", False);
}
0 on: "Programmatically apply Theme to SharePoint Site"