Please Note that your theme may use different classes, ID’s and layout structure so change the codes accordingly. This Tutorial is only to explain the concept to add custom option in weebly theme.
Code with Explanations to add Custom Option in Weebly Theme
Manifest.json Code to add Custom Option in Weebly Theme
{
“name”: “menulogoappearance”,
“title”: “Menu Logo Appearance”,
“type”: “dropdown”,
“default”: “block”,
“choices”: [
{
“value”: “block”,
“title”: “Block”
},
{
“value”: “inline”,
“title”: “Inline”
}
],
“is-body-class” : true,
“is-less-var” : false
}
as shown in following image:
Css Code to Add Custom Option in Weebly Theme
body.menulogoappearance-inline #sitename, body.menulogoappearance-inline #navigation{
width: 48%;
display: block;
float: left;
}
body.menulogoappearance-inline #header {
padding-top: 0px;
padding-bottom: 10px;
overflow: hidden;
}
body.menulogoappearance-inline div#sitename {
text-align: left;
padding-left: 20px;
}
body.menulogoappearance-inline div#navigation {
padding-bottom: 0;
margin-top: 15px;
text-align: right;
}
Html Templates Code to Add Custom Option in Weebly Theme
<div id=”header”>
<div class=”nav-trigger hamburger”>
<div class=”open-btn”>
<span class=”mobile”></span>
<span class=”mobile”></span>
<span class=”mobile”></span>
</div>
</div>
<div id=”sitename”>{logo}</div>
<div id=”navigation”>{menu}</div>
</div>
Result : Below Image Shows that New Custom Option is Added
Video Tutorial:
Please Note that your theme may use different classes, ID’s and layout structure so change the codes accordingly. This Tutorial is only to explain the concept to add custom option in weebly theme.