Tuesday, February 16, 2016

Wordpress Theme Development



style.css

/*
Theme Name: Dharamart
Theme URI: www.dharamart.blogspot.in
Version: 1
Description: Sample Worpress Theme for learner
*/
*{
margin:0;
padding:0;
}
body {
    text-align: center;
}

#wrapper {
    display: block;
    border: 1px #000 solid;
    width:90%;
    margin:0px auto;
}

#header {
    border: 2px #000 solid;
}

#content {
    width: 75%;
    border: 2px #000 solid;
    float: left;
}

#sidebar {
    width: 23%;
    border: 2px #000 solid;
    float: right;
}

#delimiter {
    clear: both;
}

#footer {
    border: 2px #000 solid;
}

.title {
    font-size: 11pt;
    font-family: arial;
    font-weight: bold;
}
ul li{
list-style:none;
}



index.php

<?php get_header(); ?>
<div id="main">
<div id="content">
<h1>Main Content Area</h1>
<?php if (have_posts()) : 
while (have_posts()) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<h4>Posted on <?php the_time('F jS, Y') ?></h4>
<p><?php the_content(__('(more...)')); ?></p>
<hr>
<?php endwhile; else: ?>
<p><?php _e('Sorry, we couldn’t find the post you are looking for.'); ?></p>
<?php endif; ?>
</div>
<?php get_sidebar(); ?>
</div>
<div id="delimiter"></div>
<?php get_footer(); ?>





header.php

<html>
<head>
<title>My Dharamart</title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
</head>
<body>
<div id="wrapper">
<div id="header">
<h1>This is the header</h1>
</div>


footer.php

<div id="footer">
<h1>This is the footer</h1>
</div>

</div>
</body>
</html>

sidebar.php


<div id="sidebar">
<h2 class="sidebartitle"><?php _e('Categories'); ?></h2>
<ul>
<?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
</ul>

<h2 class="sidebartitle"><?php _e('Archives'); ?></h2>
<ul class="list-archives">
<?php wp_get_archives('type=monthly'); ?>
</ul>
</div>


Downloading Link
https://drive.google.com/file/d/0B0vD4EvPj_p7MjEyRXVTeXJnVzg/view?usp=sharing

No comments:

Post a Comment

Dharamart.blogspot.in