In the main index template file, index.php, I added sidebar include tag, get_sidebar();. This tag will include the file sidebar.php. Now, I will talk about what information will be included in this file.
Your sidebar needs to support dynamic widget sidebar as well as old style sidebar. Hence, <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?> is needed. Next, it will be the search form. I include text input and submit input in the form. I also like to display a list of WordPress pages as links, a monthly archive links list, a list of categories as links and a list of bookmarks as links. Since all the links title does not have any html tag, I will remove both the default before text, <h2>, and default after text, </h2>, by adding empty string for title_after and title_before arguments in bookmark template tag. For meta tag list, I added wp_register(); for displaying either the “Register” link to users that are not logged in or the “Site Admin” link if a user is logged in. Adding some WordPress build-in feeds for allowing your friends to subscribe your blog, which is what I doing too. Lastly, wp_meta(); is added for allowing other WordPress plugin to insert content into this file. An example of this file is stated as following.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
Related Posts
- WordPress Theme Development 1 – Start with Theme Style Sheet
- WordPress Theme Development 2 – Minimum Main Index Template
- WordPress Theme Development 3 – Header
- WordPress Theme Development 4 – Footer
3 Comments
[...] WordPress Theme Development 5 – Sidebar [...]
[...] WordPress Theme Development 5 – Sidebar [...]
[...] WordPress Theme Development 5 – Sidebar [...]