• Disclaimer: I am completely new to WordPress. Don’t bite me please.

    I think I’m finally grasping the template hierarchy, but I’m struggling to wrap my head around front-page.php and how to properly implement it. I know what it’s for – A static home page. I also understand that WordPress is entirely dynamic so I don’t think I have this implemented incorrectly.

    At the moment my front-page.php is entirely hard-coded and designed the way I want it to look. Custom spacing, different font-sizes, etc. This means it is not possible to edit the home page from within WordPress itself. I am assuming this is not correct. I believe the correct way of implementing this is to have front-page.php use a function to output the contents of the ‘Front Page’ that I create from within the GUI?

    If this is correct, this leads me to some further questions –
    1. How do I style the front page to my liking, i.e. custom background images on each div, left-alligned in some section, right-alligned in others? I think this is my stumbling block..

    2. Themes are supposed to be somewhat generic. Perhaps generic isn’t the right word to use – Each element should be given a custom style within styles.css and this will be applied throughout the site. Let’s say for example I have one specific paragraph I want to have left-alligned white font. Another paragraph I want right-alligned black font. Another paragraph I want to have selfie.png as the background image. This is further confusing me.

Viewing 2 replies - 1 through 2 (of 2 total)
  • How do I style the front page to my liking.

    If you examine the source of the generated page, you will see that WordPress automatically applies a number of classes to the body tag. you can use these classes to style any page in WordPress using CSS.

    This is further confusing me.

    It’s not possible to really break up page content in this manner within a standard WP page. One way around this might be to widgetize the front-page.php template. You can then create your own classes as required for reach of the widget areas and style them appropriately using style.css.

    http://quirm.net/2011/09/15/widgetizing-any-page/ might help to get you started.

    Thread Starter Tadomeku

    (@tadomeku)

    The more I’m looking into this, the more I’m starting to think that WordPress is not an ideal solution. If anything this has made my life far more complicated needlessly. I had chosen WordPress for one reason only – So that my uncle can upload new photos to the web site easily in a blog-style format, i.e. “Here is some work we did today for a customer!”.

    To get the functionality I’m looking for feels ‘hackish’ and more like a work around. Can I just implement the ‘Gallery’ page in WordPress and leave everything else hard coded?

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

The topic ‘How to implement front-page.php properly’ is closed to new replies.