vBulletin Support

Vbulletin and wordpress header and footer integration problem

Submitted by gajodoporto, , Thread ID: 117502

Thread Closed
gajodoporto
Junior Member
Level:
0
Reputation:
0
Posts:
65
Likes:
20
Credits:
113
18-01-2019, 11:14 PM
This post was last modified: 19-01-2019, 04:24 PM by gajodoporto
#1
So im working in a project that will have Wordpress has the main page and then vbulletin as a forum. I already connected both platforms with a plugin so the users can login either in wordpress or in vbulletin.

Now for the design part, I want the vbulletin forum page to have the wordpress header and footer, searched on google and found that that can be achieved by creating a plugin/hook in vbulletin like this:
Code:
ob_start();
include( '../wp-load.php');
include('../wp-content/themes/Avada/header.php');
$wp_header = ob_get_contents();
ob_end_clean();

after that just insert $wp_header in vbulletin header file.

Problem is nothing happens, all I get is "$wp_header" written on top of my vbulletin page.

EDIT:
I have my wordpress installed in a folder 'apostasgreen',
and vbulletin in the folder 'apostasgreen/forum'.
maybe my file paths are wrong?

EDIT 2:
Getting slowly there, got a few improvements after searching in google:

1. Do not use 'global_start' while creating the plugin, instead select 'global_bootstrap_init_start'.
2. I found this code so I changed it on the plugin and this time something actually shows up:
Code:
ob_start();
include('../wp-load.php');
include('../wp-content/themes/Avada/header.php');
$wp_header= ob_get_contents();
ob_end_clean();

$preRegister['wp_header'] = $wp_header;
vB_Template::preRegister('header', $preRegister);

After changing this code I also added this '{vb:raw $wp_header}' to vbulletin header theme file. Now it shows like this:

[Image: PyRdiZB.png]

I think some css code is missing here, maybe path to css files are wrong, any help here please?
I

Users browsing this thread: 1 Guest(s)