Support » Themes and Templates » Multiple themes -problem with post.php

  • Resolved eveums


    I have tried using several different themes, from several different authors, that include a post.php page. I end up with an error message that the post.php can’t be located in the directory. The post.php page is there, though.

    Since it’s a problem with a few themes I’ve used, and only with the “post.php” page, I’m wondering if there is something wrong with my blog using post.php pages… I’m wondering if there’s something wrong with my blog, or if I just picked up a few bum themes.

    Does anyone have any ideas? Thanks!!!

Viewing 9 replies - 1 through 9 (of 9 total)
  • And what exactly is post.php for? It’s not a part of WP’s theme hierarchy, so I assume these themes are including it into other templates for the post loop (assume because, with no themes mentioned, there’s no way to know for sure).

    Specifically, I was having problems with the Letterhead and Connections themes.

    I’m not very familiar with PHP or the Loop in WP, so I’m not sure how to decode what “post.php” is used for. Is there any kind of information that I could provide that would give some answers to that question?

    Thanks for the help!!

    The theme names are enough (those who are familiar with PHP, The Loop, and are motivated to take a look can figure the rest).

    From a quick glance I don’t see anything that may be causing this in those themes, other than perhaps some conflict when run off your server. Perhaps the location of post.php is not being seen as local to your templates, so you might try editing the line in each template that loads post.php:

    <?php require('post.php'); ?>

    and change it to:

    <?php require(TEMPLATEPATH . '/post.php'); ?>

    Thanks for the help. I made the change, changing TEMPLATEPATH to “Letterhead” – the directory where the files are. I get the following errors:

    Warning: main(letterhead/post.php): failed to open stream: No such file or directory in /home/[username]/public_html/wordpress/wp-content/themes/letterhead/index.php on line 6

    Fatal error: main(): Failed opening required 'letterhead/post.php' (include_path='.:/usr/local/lib/php') in /home/[username]/public_html/wordpress/wp-content/themes/letterhead/index.php on line 6

    I’ve also tried deactivating all the plugins from the blog, as well. Same problem. Strange, huh?

    No, you don’t replace TEMPLATEPATH with anything. Literally, as is, put the following code.

    <?php require(TEMPLATEPATH . '/post.php'); ?>

    *blushing* Sorry, dumb mistake, I didn’t know the word TEMPLATEPATH was actually part of the code.

    The TEMPLATEPATH suggestion worked perfectly. Thanks for the help Kafkaesqui and Alphaoide!!


    I have the same error mesages.

    Warning: main() [function.main]: Unable to access /mnt/storage/users/c/l/a/clandestina/wp-content/themes/connectionspost.php in /mnt/storage/users/c/l/a/clandestina/wp-content/themes/connections/index.php on line 25

    Warning: main(/mnt/storage/users/c/l/a/clandestina/wp-content/themes/connectionspost.php) [function.main]: failed to open stream: No such file or directory in /mnt/storage/users/c/l/a/clandestina/wp-content/themes/connections/index.php on line 25

    Fatal error: main() [function.require]: Failed opening required ‘/mnt/storage/users/c/l/a/clandestina/wp-content/themes/connectionspost.php’ (include_path=’.:/usr/lib/php’) in /mnt/storage/users/c/l/a/clandestina/wp-content/themes/connections/index.php on line 25

    I tryed to put:

    <?php require(TEMPLATEPATH . ‘/post.php’); ?>

    instead of:

    <?php require( ‘/post.php’); ?>

    But it is still not working. Now the only thing i can see on my web is a completely white page. Can somebody help me please?


    clandestina, are you sure you used:

    <?php require(TEMPLATEPATH . '/post.php'); ?>

    Looking at this part of the errors:


    it seems to show the slash before post.php was left out.

    Just wanted to note that another way to solve this problem is to replace the require <post.php> line of code with all the code included on the post.php page itself. This worked for me when the above solution didn’t (such as with the Exquisite theme).

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Multiple themes -problem with post.php’ is closed to new replies.