WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] I have created a custom layout now to turn it to a theme (10 posts)

  1. xtra
    Member
    Posted 6 years ago #

    I have created my design, a simple layout with a content, navigation and footer section. I am looking at just creating a static page for the index but having a news section for another page (use the blog tool)

    I wanted too ask if anyone can point me to a direct tutorial of integrating my design into a theme, I have found the wordpress lessons but wondered if there was an easy tut that showed you a basic set up otherwise is it a case of reading through each of the pages in wordpress lessons?
    http://codex.wordpress.org/WordPress_Lessons

  2. Joni
    Member
    Posted 6 years ago #

  3. xtra
    Member
    Posted 6 years ago #

    Cheers, thanks for the link, will I need much luck? I have good understanding of html/css but only understand the concept of php

  4. Joni
    Member
    Posted 6 years ago #

    Unless you are doing some custom work with the WP loop, you don't really need to know much PHP. I think if you want to develop a theme, it's more important that the theme itself is tight, that its HTML and CSS validate. (Later on, people will download it and add sloppily constructed plugins that will cause the HTML to not validate, but as long as it does so when you release it to the public, you are fine.)

    Here's one other tip for you, worth exactly what you paid for it. :)

    If you decide to include in your sidebar the code for some of the more popular plugins (such as Alex King's share this, recent comments, etc.), it's always best to leave a "plugin parachute" as I call it. The code below tells WP to ignore that code IF the plugin is not installed or activated. This keeps the sidebar from throwing up on itself if the person using your theme hasn't downloaded or activated that particular plugin. Just another way to tidy up after yourself. The example below is for MTDewVirus's Recent Comments plugin:

    Normally, the plugin code looks like this:

    <ul>
    	<?php mdv_recent_comments() ?>
    </ul>

    You want to add some code like I mentioned above to tell WP to ignore the plugin call if it's not installed:

    <?php if (function_exists('mdv_recent_comments')) { ?>
    <ul>
    	<?php mdv_recent_comments() ?>
    </ul>
    <?php } ?>

    Notice this code before the actual plugin code:
    <?php if (function_exists('mdv_recent_comments')) { ?>

    And this code afterward:
    <?php } ?>

  5. xtra
    Member
    Posted 6 years ago #

    Hey thanks for that info.

    My code xhtml/css is validating and is clean.

    It is very simple, content (news box which sits inside content), sidebar and footer

    I will try and have on the front page a little news box highlighting the latest three news-blog entries, so what you have mentioned here is something I will need to learn about.

    When I look in the default theme folder there is a lot of files? do I need them all, as the site I will make want allow for comments, its just going to be for a basic 5-8page website that can use the CMS feature of WP, I thought for learning WP it is best to start out small

  6. xtra
    Member
    Posted 6 years ago #

    Just found a basic tutorial which looks like a simple starting point.

  7. Joni
    Member
    Posted 6 years ago #

    My code xhtml/css is validating and is clean.

    This is excellent. And yep, that's a great tutorial! Now go forth and create!

    Now, about the templates. These are the default templates:

    header.php
    footer.php
    sidebar.php
    index.php
    comments.php

    I generally also include:
    page.php (I strip the comments template out because I don't believe you should invite comments on static pages, but that's just a personal preference)

    single.php (you can add extra post-specific elements here .. check the kubrick/default theme single.php template for some ideas)

    functions.php (the bare bones widget code goes here)

    Make sure that you widgetize your themes, people really seem to like that; it will make your blog stand out among those that are not widgetized.

  8. xtra
    Member
    Posted 6 years ago #

    Cheers will see how far I get! Thanks

  9. Joni
    Member
    Posted 6 years ago #

    Oh, here's one more nice article about WP themes that you might enjoy.
    http://www.noupe.com/wordpress/mastering-your-wordpress-theme-hacks-and-techniques.html

  10. xtra
    Member
    Posted 6 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic