Log in

View Full Version : How to Insert Code Above <html> and <head> tags?


BigDaveyDD
07-04-2007, 02:42 AM
I'm trying to make it so I can call a few Wordpress php functions from within VBulletin, but in order to do so, they say I need to add the following code ABOVE the <html> and <head> tags. I don't seem to be able to do this in either the head template or headinclude template. Anyone know where I can?

<?php include_once('/path/to/wordpress/wp-blog-header.php'); ?>
<html>
<head>
<title>Title Of Your Page</title>
<?php wp_head(); ?>
</head>
<body>
<?php get_poll(); ?>
</body>
</html>

I've been searching through here, vb.com, and wp.com, and can't seem to find how to do this. Thanks in advance for anyone here who can help.

Dismounted
07-04-2007, 04:52 AM
You can't include raw PHP in templates.

http://www.vbulletin.com/docs/html/templates_externalfiles

BigDaveyDD
07-04-2007, 12:17 PM
Thanks for the reply, and yes I'm familiar with plugins as I have a few working right now, but that still leaves me with the problem of posting the plugin code ABOVE the <html> and <head> tags.

Any idea how or where to do this?

Thanks again.

Dismounted
07-04-2007, 12:43 PM
I just told you with the link, use the object buffer functions to fetch the data and place the variable in the template instead.

BigDaveyDD
07-04-2007, 12:51 PM
That link just talks about how to use plugins to place external files and php includes, etc. in templates right? I know how to do that, but I need to know which template to put the plugin code in, so that the plugin code is ABOVE the <html> and <head> tags.

I've looked in the "head" and "headinclude" templates, but neither will allow me to view or post ABOVE the <html> and <head> tags.

See what I mean, is this possible?

Paul M
07-04-2007, 08:27 PM
The html and head tags are contained in each pages root template (e.g. FORUMHOME, SHOWTHREAD). Normally the HTML Doctype stylevar is output first (above them).

BigDaveyDD
07-04-2007, 08:33 PM
Perfect, that's exactly what I was looking for Paul. Now, it will be very interesting to try a few combinations of plugins/php to see if I can get it to do what I want.

Thanks!