Thursday 16 June 2011

Layout


This image gives an overview of what I'm working with, and what I want to change.  This is the default post layout.  In order for a post to display properly on the main page's gallery feature, it must have defined a 'featured image'.  However, by default, the image page itself has the layout above - lots of gubbins to either side, and a copy of the featured image at the top, duplicating the contents of the post.  I'm currently taking a delve into the .php file which generates the html.  Just by commenting bits out I have removed the left-hand bar.  Such beautifully readable code!

I've got rid of the left-hand 'aside' bar, but the right-hand bar, the 'sidebar', doesn't seem to be disableable in this theme.  I'm having a look through the other .php files to find where it's called from, as just commenting out the contents of 'sidebar.php' leaves it blank, but still in existence. 

Note to self: use "grep sidebar *"  to search all files in the current directory for a word.

Hmm.  Well, some bits are proving easy to remove, and others are a little more tricky.  Some of it's coded directly in the .php files as html, some of it's done entirely in css, and it's all interrelated by a really opaque network of calls and references.  Having prodded it a bit and broken it a lot, I think it's time to delete, reinstall and start again.

Hooray!  Minor victory: figuring out the custom menu feature.  It's pretty nifty!  You can nest links, but the optional 'category' link doesn't expand to a list of posts, rather it links you to another image-slider index page.

I'm using the menu in the footer instead of a header, to keep the look clean.  I'm not sure whether I might later adapt the footer to be fixed to the bottom of the window, rather than the page, but once I've got some content I'll see how it works.  If it doesn't work down there, it should be fairly simple to shift the include which calls the footer menu code into the header bar instead.  Back to trying to slim down the page layouts.

Well, after working on it from 12 to 6, I've now discovered something called "child themes" which allow you to override the parent theme without modifying it and having to delete and reinstall if you muck something up.  Woo.  So!  Now to delete, reinstall, create a child theme and do it all again! 

Half an hour of trying to get the child theme to work, I discover experimentally that the problem was a capital letter.  ARGH.  And two hours later, I discover that the whole thing was a waste of time, and I can't change what I wanted to.

Well, that feels rather like it has all been an exercise in futility, but I have made some useful changes and learned a lot more about exactly how Wordpress's themes work.

8.5 hours of code and grep and hitting refresh... I'm going to go bake a cake. 

No comments:

Post a Comment