Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] Is it ok to edit WordPress template files directly?

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #30117
    dannyj
    Member

    I recently built a site using the Thematic child theme. It relies heavily on the functions.php file. I’m a web design veteran but somewhat of a newbie WordPress coder. Is it a ok to use a blank theme that has the template files like header, footer, sidebar and add code directly to the templates? I’m not talking about modifying the core code but adding code, an image, a widget area directly to template files. Right now I’m finding it more of a task to add all the extensibility only to the functions.php file as Thematic does. I’d like to create a widget area using the functions.php file and add the code directly into the template file too. Maybe even add a div or image directly to the template code. —Is this OK in wordpress? Will I run into trouble when newer versions of wordpress or the theme come out?

    #81247
    jamygolden
    Member

    Yes it’s ok to do that and no I don’t think you’ll run into any trouble.

    That is what creating a theme is all about – Manipulating the template files to achieve your goal.

    #81248
    Luminated
    Member

    You can definitely edit the template files without harming any possible future upgrades…that is really one of the best parts about the WordPress templating system! You can modify the functions.php and all the template files to your heart’s content without ever compromising the core WP functions. This is how the best WP sites are made.

    #80793
    dannyj
    Member

    Thank God. I like the Thematic framework but it is too purist feeling for me and a bit cumbersome for my WP level. I do much better getting into the template files themselves. Thank you.

    #80794
    Chris Coyier
    Keymaster

    This is a good way to handle using a theme like Thematic and editing your own theme while leaving the core (and Thematic) alone.

    http://codex.wordpress.org/Child_Themes

    Make a new theme folder. Put the CSS comment from that link above into your own style.css file in that new theme. Change the “template” to point to the Thematic folder. Then put your own functions.php file in this folder as well. This theme folder (now a “Child theme”) has just these two files in it. You can now activate and use this theme, and 99% of it will be pulling and using stuff from Thematic, only your custom functions.php file be used as well, allowing you customize without overwriting anything.

    #80791
    dannyj
    Member

    Thanks, Chris. I recently built a child theme site using Thematic. It was a pretty steep learning curve for me. I was wanting to find a blank theme (for a new project) where I could physically add some widget areas to the theme template pages – create the function in the functions file and add the widget area to the template. It seems much less confusing to me rather than having everything in the functions.php file. Not knowing the WordPress rules very well yet, I wasn’t sure it was proper to add code directly to the theme template files themselves.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘CSS’ is closed to new topics and replies.