• I’m new and lost, but I’ve been reading so please graciously excuse my ingorance.
    I have designed/built a site using a PHP template that calls include files for the main content area. I would like to use WordPress to edit the content in each section. Example:
    <div>
    <? include (“$pg”); ?>
    </div>
    So I have includes such as “about.php,” “contact.php,” etc. I want to be able to write and edit to those include files rather than the index.php template. However, on the Write and Edit pages I see no options for this.
    Is there a way to choose which file I wish to write or edit?

Viewing 3 replies - 1 through 3 (of 3 total)
  • I’m not sure if there’s a way to “post” to them but if you chmod 666 any files you want to edit you can then bring them up in the “template” section where you can edit them directly. If they are files you edit regularly you can add them to the menu underneath the editing window but that requires editing the template.php file in the wp-admin folder. If you scroll down nearly to the bottom of that file you will see a little block of HTML which is the menu list. Just add your files there in the same format. Don’t forget they must be chmod 666 and if you upgrade WP you will need to modify the template.php file again.

    Thread Starter veganpower

    (@veganpower)

    Thanks for your reply, Stuart. I tried that and successfully managed to make that happen. But the beautiful aspect of the Write and Edit pages is that someone with no HTML skills can apply text formatting, whereas the Template page brings up raw HTML.
    If the Write and Edit pages had a list like the Template page, we could select from the list and edit accordingly. That seems logical and rather simple, but of course I’m being presumptuous.
    Any thoughts on how to modify those pages to bring up a list like the Template page?

    The answer to your last question is no I don’t. The problem with it though is that you still wouldn’t be able to “post” to the page. Now I’m thinking off the top of my head here but I would have thought that one solution would be to have a PHP “include” on your page that just calls one specific post. You would then be able to edit that post whenever you needed to. You would need to make it invisible to your Blog page though else it will appear there in the normal manner. Marking it as “private” or “draft” would do that or give it it’s own “category” which is hidden from the Blog but I’m not sure if that would also affect the page you want it to appear on. As that page is outside the Blog it might ignore this. Now you need someone with more PHP knowledge than me to tell you how this can be done. I haven’t tried it myself but there is a “Staticise” plugin over on the Wiki which you might find useful.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Can I use WP with a PHP template?’ is closed to new replies.