News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

WP header above SMF

Started by Westwegoman, June 08, 2014, 01:44:17 PM

Previous topic - Next topic

Westwegoman

After several hours of searching, I have gotten close to what I want to do but ran into a little snag.

I am trying to include the header of my WordPress site on top of my SMF forum. I have the following.

Wordpress path is in /wordpress
SMF forum is in /Community2 (a test forum)

In the root of the site I have created a file named wpheader.php and inside this file I have tried using the following. (not at the same time)
<?php
require( 'wordpress/wp-load.php' );
get_header();
?>

<?php
require( 'wordpress/wp-blog-header.php' );
get_header();
?>


Inside my themes index.template.php file I have added the following at the beginning of the file:
<?php 
/* Short and sweet */
define('WP_USE_THEMES'false);
require(
'../wpheader.php');
?>


My problem is, there seems to be some css conflict. It displays correctly if I directly access the file at the following URL:
http://www.bayoustatefishing.com/wpheader.php

But looking at the forum, there is an issue. It seems the main_block.png image is showing in the header. I'm guessing there is some sort of clash between the css somehow.
http://www.bayoustatefishing.com/community2/index.php

Has anybody had success with this. I have found a lot of info through searches that all say this works in external pages but I can't seem to make it work in SMF.

Kindred

Ther eis more than a CSS conflict.

There is a known conflict between SMF and WP variable names as well as CSS>

In other words, WordPress does not play nicely with anything else, including SMF...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

That and blindly shoving it into the template file really isn't going to work anyway. At best you'd need to place the code part-way inside template_body_above() rather than at the top of the file.

Westwegoman

Quote from: Arantor on June 08, 2014, 06:38:03 PM
At best you'd need to place the code part-way inside template_body_above() rather than at the top of the file.
I just tried placing the following:
define('WP_USE_THEMES', false);
require('../wpheader.php');

after:
function template_body_above()
{

But it didn't work.

On my original forum I have:
include('header.php');
After:
</head>
<body>';

And it works perfect , as you can see here.
http://www.bayoustatefishing.com/community/index.php

Arantor

-sigh- I didn't say 'just inside', knowing full well it wasn't going to be the first thing you'd put in the function...

Westwegoman

I just did it with a separate css menu. I'll have to manually edit it but it's better than nothing.

Advertisement: