Update your theme.xml
to include a more complex layout:
<body>
<div id='wrapper'>
<header>
<h1><data:blog.title/></h1>
<p><data:blog.description/></p>
</header>
<nav>
<b:section id='navigation' maxwidgets='1' showaddelement='false'>
<b:widget id='PageList1' locked='true' title='Pages' type='PageList'/>
</b:section>
</nav>
<div id='content-wrapper'>
<main>
<b:section id='main' showaddelement='true'>
<b:widget id='Blog1' locked='true' title='Blog Posts' type='Blog'/>
</b:section>
</main>
<aside>
<b:section id='sidebar' showaddelement='true'>
<!-- Sidebar widgets will go here -->
</b:section>
</aside>
</div>
<footer>
<p>© <data:blog.title/> <data:blog.currentYear/></p>
</footer>
</div>
</body>
Update your CSS to style the new layout:
#wrapper {
display : grid ;
grid-template-areas :
"header header"
"nav nav"
"main sidebar"
"footer footer" ;
grid-template-columns : 1 fr 300 px ;
gap : 20 px ;
max-width : 1200 px ;
margin : 0 auto ;
padding : 20 px ;
}
header { grid-area : header; }
nav { grid-area : nav; }
main { grid-area : main; }
aside { grid-area : sidebar; }
footer { grid-area : footer; }
@media ( max-width : 768 px ) {
#wrapper {
grid-template-areas :
"header"
"nav"
"main"
"sidebar"
"footer" ;
grid-template-columns : 1 fr ;
}
}
Define a color palette in your CSS:
:root {
--primary-color : #3498db ;
--secondary-color : #2ecc71 ;
--text-color : #333333 ;
--background-color : #ffffff ;
--accent-color : #e74c3c ;
}
Use the color variables throughout your CSS:
body {
background-color : var ( --background-color );
color : var ( --text-color );
}
header {
background-color : var ( --primary-color );
color : var ( --background-color );
}
a {
color : var ( --secondary-color );
}
.post-title {
color : var ( --primary-color );
}
.button {
background-color : var ( --accent-color );
color : var ( --background-color );
}
Add Google Fonts to your theme.xml
:
<head>
<link href='https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&family=Lora&display=swap' rel='stylesheet'/>
<!-- Other head content -->
</head>
Update your CSS to use the new fonts:
body {
font-family : 'Roboto' , sans-serif ;
}
h1 , h2 , h3 , h4 , h5 , h6 {
font-family : 'Lora' , serif ;
}
Add this to your theme.xml
inside the <b:section id='sidebar'>
:
<b:widget id='AuthorProfile1' locked='false' title='About the Author' type='AuthorProfile'>
<b:widget-settings>
<b:widget-setting name='showaboutme'>true</b:widget-setting>
<b:widget-setting name='showlocation'>true</b:widget-setting>
</b:widget-settings>
</b:widget>
Add CSS for the new widget:
.author-profile {
background-color : #f9f9f9 ;
border-radius : 8 px ;
padding : 20 px ;
text-align : center ;
}
.author-avatar {
border-radius : 50 % ;
margin-bottom : 10 px ;
}
.author-name {
font-size : 1.2 em ;
color : var ( --primary-color );
}
Add more responsive styles to your CSS:
@media ( max-width : 600 px ) {
body {
font-size : 14 px ;
}
#wrapper {
padding : 10 px ;
}
.post-title {
font-size : 1.5 em ;
}
}
Ensure images are responsive:
img {
max-width : 100 % ;
height : auto ;
}
Add this to your theme.xml
:
<b:if cond='data:blog.pageType == "static_page"'>
<div class='page-content'>
<h2><data:blog.pageName/></h2>
<div class='page-body'>
<data:blog.pageBody/>
</div>
</div>
</b:if>
Add CSS for custom pages:
.page-content {
background-color : #f9f9f9 ;
padding : 30 px ;
border-radius : 8 px ;
}
.page-body {
line-height : 1.8 ;
}
These customizations will give your Blogger theme a unique and professional look. Remember to test your theme thoroughly after making changes, especially on different devices and browsers.
In the next section, we'll explore advanced techniques to take your Blogger theme to the next level. Keep experimenting and refining your design to create the perfect theme for your blog!