问题
I am working on the vbulletin 4.2 with wordpress. I need wordpress header and footer for that I got some tutorial on url :- http://bythegram.ca/2012/07/tutorials/wordpress-meets-vbulletin/ I have done accroding to the given tutorial but didnt get success.
The files are included in the vbulletin forum page but they are not showing on vbulletin.
Please help me out. Thanks in advance.
Regards
回答1:
After a Long Search I got the solution... And I want to share it will all the person who is working with vbulletin...
WordPress meet vBulletin:
So you have a vBulletin Forum and a WordPress website but they just don’t play nice with each other.
This tutorial will help trick your vBulletin Forum to look and feel like your WordPress site by integrating your header, footer and sidebars (if you have them).
First if you love working in WordPress, I’m sorry, this is actually more of a tutorial in vBulletin plugin/templates, but don’t worry it is easy.
Step 1:
Create a WP Header Plugin:
Hook Location: global_start Title: WP Header Execution Order: 5 (or default)
ob_start();
include('../wp-load.php');
include('../wp-content/themes/rt_iridium_wp/header2.php');
$globalWPHeader= ob_get_contents();
ob_end_clean();
$preRegister['globalWPHeader'] = $globalWPHeader;
vB_Template::preRegister('header', $preRegister);
explaination: include ‘../htdocs/wp-load.php’; This line is looking for your ‘wp-load.php’ file so change the location according to your setup. include(‘../htdocs/wp-content/themes/gazette/header.php’); Finds your ‘header.php’ file, change location accordingly. $wp_header = ob_get_contents();
Assigns the ‘header.php’ content to the variable $wp_header
Edit the header Template:
Style Manager-Edit Templates-header:
I’m sure you’re header template will look a little different from mine but this is were you include $wp_header plugin which will insert your wordpress header into your vBulletin forum.
{vb:raw $globalWPHeader}
Add this line in header of template of the vbulletin via admincp.
Thanks
来源:https://stackoverflow.com/questions/16580818/how-to-add-wordpress-header-and-footer-in-vbulletin-4-2