how to add wordpress header and footer in vbulletin 4.2

懵懂的女人 提交于 2019-12-08 13:55:29

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!