no, especially when you are trying to do this inside an HTML page..
HTML and files that end in .html ie, page.html are static.
PHP and files that end in .php ie, page.php are dynamic.
Consequently, you cannot just copy and paste PHP into an HTML page. Thats not how it works.
All you have to do is rename the *.html page to *.php – assuming your host doesn’t have some restrictions that would make that impossible.
i disagree, and thats begging for more questions in this thread.
What does the loop.php have in it? Its not a core wp file so thats important to know. Does it call wp-blog-header.php? If it doesnt, it wont work. Is the path to wp-blog-header.php correct within it, assuming it IS calling it? If it isnt, it wont work.
If it isnt calling wp-blog-header.php are the necessary functions included? If not, it wont work.
One cannot just rename an HTML file to .php and expect it to work, and (no offense, V) that answer is too simplistic for his question.
Well, no offense taken of course. But (leaving wp and the loop out of it for the moment), yes, you can simply rename an html file to php. (I do it all the time.) First he needs to find out if THAT’S an option with his host. It’s not with every host out there.
THEN if it is, he can be guided as to things like calling wp-blog-header etc. in order to get the loop working. But first he needs to find out if his host will be okay with index.php instead of index.html or index.htm….
Well, according to my experiments, you are both right…sort of.
You can rename between .htm and .php without a problem, but going from an HTML file to the index.php file is futile. WordPress will regenerate the code and rewrite the file each time it builds. So your original HTML will be replaced on the first re-build of the site.
I have had some success in renaming php files to html and using them as static pages. There does not seem to be any problem with doing this.
In summary, I think the answer to my question is this: there is no way to call “the loop” from within an html page. Anything I wanted to have appear on the HTML page has to be done through template modifications–so that WP can build the index.php page dynamically.
I’ve had some luck accomplishing this wth template modifications. It just means getting more deeply into the templates than I wanted.
Thanks for all your comments.