• i have a very simple site, where all my pages, whether they be index, archive, single, etc, are all the same. all elements (footer, header, sidebar, etc) all in the exact same space, no matter where you are in my site.

    whenever i want to make a design change to my site, i have to go into the theme folder, and then into header.php, sidebar.php, footer.php, etc and then make my changes in each file. i’m finding this to be a hassle, as i tend to redesign my journal frequently, being a visual designer who uses my journal as a playground. i would much rather have just one file to have to modify, index.php.

    does anyone know of a resource that would explain details involved in consolidating all those little .php files (sidebar, footer, etc) into just one file, index.php? obviously, i don’t want to use themes, and i read on how to change disable themes. i want to take this a step further, however. what i am specifically worried about is wp_header.php, it appears to be quite necessary.

    i think this the information answering can be found in these support forums, i’ve looked, i just don’t know the right question to ask. i’m willing to be admonished if someone can point me to a place where said information can easily be found. thank you!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Open them up, then copy out of each one, and placing it into your index.php file. If you look for include commands (or the wp get_ functions), that should give you a cluse as to where to put each file’s contents. Example: If your index reads wp_get_header() then that’s where your header.php contents go.

    Tg

    If you don’t want to use all the sidebar.php/header.php/footer.php files, just copy the content out of those files, and paste them into your index.php where you would make the header/footer/sidebar calls. It’s the same thing.

    Start out with the WP Classic and your base will be closer to what you need. I am inclined to agree with this line of thinking. Split files can be cool but in many cases introduce complexity to the end user without any defineable benefit. None of it is mandatory. Do what you feel best with.

    Thread Starter misfit

    (@misfit)

    thank you both for your replies (and very sorry for the delay.) i do (like you, root) prefer a much simpler approach.

    something i’ve realized, though, is that although all my pages look exactly the same, still, different pages exist (category, archives, individual, index), and maybe, at least in this small sense, it might be sensible to approach it from a modular framework.

    because to do it my way, if i merged all into just one index.php, i believe i’d have to recopy that index.php as archive.php, and then rip out the center of the post and plug in the code to call the archive content instead. and then i’d have to do the same for all my other different types of pages.

    so, one the one hand, the modular approach makes a lot of sense. but on the other hand, the modular approach is making it harder for me to experiment with visual design.

    i guess my task is to figure out which is more important for me.

    thanks!

    Well I have used the reverse approach. In all cases if the file is missing WP loads index. So delete archives, pages etc and it will be fine.

    Part of your original question wasn’t answered. What’s in these things? Here is some information that should help you learn more about how these template files work, and how to control which parts when.

    Template Files
    Template Tags
    Using WordPress Themes
    Developing WordPress Themes

    Also, as another person who tends to tweak and twiddle with her site, I find working with the different modular template files actually a total delight. Without scrolling through tons of code that I might, with a slip of the finger, screw up by accident, I can concentrate on what part of the site I want to change. If I’m working on the footer, I only have the footer in front of me. This form of “less code” and distractions really helped me, though I fought it for a long time because it wasn’t what I was used to.

    And the majority of my changes happen in the style sheet, so once the template files are “done”, I rarely open those unless I found a new plugin in or something that requires modifying the template file.

    Also, the ease of making a conditional statement that allows me to change one particular category of posts with a different style sheet or sidebar or header…that’s a very powerful capability that I’ve used on my site that thrills me to no end. With static html pages, I had one sidebar and one header and one footer for the WHOLE thing unless I went in and specifically changed that particular html page to make it different from the rest. Now, I can have a single category of posts look completely different from the others. That’s power and control.

    You could also look at wp.php. It is an example of a very simple “template-less” template. It basically has a simple header, the loop, and a simple footer. If you were going to use this you need to make sure templates are disabled (they should be by default) and rename it to index.php. At least that is what I figured out so far.

    After I login to my blog with the wp-login.php file, I am directed to the index.php page. From that page, I could not find a link to make a new blog post. What PHP file must I use in order to make a new blog post?
    Dennis, userid: cgn

    Normally the login should take you to the /wp-admin/index.php. Did you modify anything in the login file? What theme are you using? If the theme doesn’t have a login link, just type in your address bar:
    yoursite.com/blog/wp-admin – and hit Enter.

    Edit. P.S. Your problem has nothing to do with the topic of this thread. Next time start your own topic.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘one index.php file, that’s it. how do i do this?’ is closed to new replies.