• I would eventually (well I leave the country a week tomorrow so not too eventually) like to have my blog look like the rest of my site.

    Now I recognise that this will probably mean changing the wordpress code (or creating a template for it) and using that code for my other pages.

    So, I’ve been trying to get my head round how my blog comes to look like it does. Now I have just given myself a crash course in css and div tags and I understand the concept of a rule and how one uses a div tag to apply that rule to the html within it, so when I look at the code I see that going on. Of course its much more complex than that, but I’ve a vague idea of what’s happening.

    Now the reason for their being so many .php files is so that the current page can simply point at that file rather than have the actual code within it. Is that about right?

    So I understand that what I need to deal with is header.php (whatever normally goes in ‘head’, meta data, css code), index.php (the main content – the blog itself?), sidebar.php (self-explanatory) and footer.php (what normally goes at the bottom…duh).

    And I also need to deal with the stylesheet, in order to have my own fonts, positioning of objects etc. etc.

    Well this is just me trying to get to grips with it all for lack of knowing what direction to go in. Sorry to babble.

    Perhaps someone would take a peak at the code of my site (mathgoesawol.com) and come up with a start point regarding all this. Be aware I haven’t used css (I think I made one text style with it, but that’s all) so I’m aware things will need to be redone. The site doesn’t have to look exactly as it does now, as long as I can keep the navigation bar (which was made – rollovers and all – in fireworks, which may well complicate the issue).

    *Phew* if you got to the end have a packet of your favourite cookies. If you can help, grab a box!

Viewing 6 replies - 1 through 6 (of 6 total)
  • In your case I would go in this way:
    Save your index file as index.php in a folder called for example “mytheme” under wp-content/themes.
    Add a style.css file to the same folder with the lines that you can find on the top of any theme’s stylesheet (of course, replacing the info with your own).
    In the meantime keep this open in another window 🙂
    Theme_Development

    Take the Classic theme that comes with the package and copy/paste the Template_Tags you find in the files into your own index.php, starting with the header.php > index.php > sidebar.php > footer.php.
    So, for example, where you have now the title and text of your main page, you will copy over The_Loop with all its tags: title, content etc.
    The comments.php file can simply be copied over into your directory.

    All the files (and the others) basically are a huge index file “sliced” up… see a visual represantation of it here: Visual anatomy of a theme.

    You can keep your theme in one single index file (an index and a stylesheet is enough to have a theme), or you can just slice it up and add more template files – it makes the customization easier.
    The Template_Hierarchy will tell you which files are used in different situations/views.

    Thread Starter MatthewMcCabe

    (@matthewmccabe)

    Thanks moshu. I won’t pretend to understand that at first glance but I’ll try to dissect it now :).

    Thread Starter MatthewMcCabe

    (@matthewmccabe)

    Something that’s really annoying me: Why can’t I find a template tag for header.php in any of the pages of my blog? There’s evidently something here that I don’t understand!

    In fact I can’t seem to find any template tags.

    I am not sure I understand your question.
    The Template_Tags are mainly for displaying different information (data) bits from your posts and Pages; and also for providing internal links in WP for different views etc.

    In the header.php usually you have the <head></head> portion of a “normal” webpage – and for the sake of easy handling you might also have the top horizontal navigation/menu. Since the header.php is called by all the other template files, it make sense to put the navigation there, so you can edit it in one single place.

    So, what exactly are you looking for?

    Thread Starter MatthewMcCabe

    (@matthewmccabe)

    When I see the ‘pages of my blog’ I mean the code (and I can see how that was misleading!). When I do a view source on any page in my blog (mathgoesawol.com/blog/wordpress) I can’t seem to find the php functions which point at php files (like header). If I could see them in my own blog it would help me visualise what’s going on.

    Thread Starter MatthewMcCabe

    (@matthewmccabe)

    This is fast becoming a monologue hehe.

    Anyway I think I was being a bit thick and have made a bit of a conceptual step with this:

    index.php includes the php functions or template tags (e.g. <?php get_header(); ?>) for the various php files (e.g. header and footer), but when I view the ‘page source’ rather than showing the function it shows me (for example) the content of the header itself. And any php functions within header.php (e.g. <?php bloginfo(‘name’); ?> ) are actually shown as the ‘result’ (in my case Anatolian Adventures).

    This is probably basic php knowledge but I’m coming at this the wrong way round :S.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Help me get my head round the WordPress code.’ is closed to new replies.