Support » Plugins » Having issues integrating wordpress header into SMF

  • I tried posting this topic on the SMF forums yesterday but haven’t gotten a response yet, so I figured I’d try posting it here.

    I’ve done a lot of integration with wordpress and external sites and I just can’t figure out how to fix this issue.

    Over at we have featured articles on the header, that’s the only reason I want to integrate the header directly, otherwise I would just do it manually with HTML code.

    Well, I’ve been tinkering with this for hours and these are the ends I’m stuck at:

    I can randomly drop the code into the top or bottom of the smf index.php file for the root directory of SMF and this is what happens:

    Which is good and bad at the same time. It’s great that it’s including the header! I only want it to include it once though.. but the thing is, when I try to include the header in a logical way so it only appears once it directs me to a non-existant wordpress install in the SMF directory.

    Here are solutions I have tried that all lead me to the non-existant install directory:
    – Including the code right after the body tag in index.template.php
    – Creating a function called wpHeader(); with the code in index.php and calling it in index.template.php
    – Including the code in the beginning of the smf_main(); function in the index.php file

    the code in question that I’m talking about:

    define('WP_USE_THEMES', false);

    The wordpress blog is installed in the /home/blog/ directory and SMF is installed in /home/smf/ directory. I was thinking maybe that could be an issue, but I wanted to see if other people thought it could be before I go crazy and move everything.

    I mean seriously XD this is making me pull my hair out. XD. I’m hoping I can get an answer here, but if not I’ll try the wordpress forums… *prays*

    Oh, and sorry if this was the wrong forum to post this topic in. It just seemed the most appropriate.

Viewing 1 replies (of 1 total)
  • Alright well… I got the template issues sorted out, but now I’ve ran into different problems. The problems I’m running into now are that the featured images don’t load, and I can’t login, some kind of cookie problem according to SMF.

    Look for yourself:

    Anyways, this is the current situation I got going…

    SMF index.php
    right before
    $forum_version = 'SMF 2.0';


    SMF index.template.php
    right after

    function template_body_above()
    	global $context, $settings, $options, $scripturl, $txt, $modSettings;

    here is the code i use to fetch featured images with in wordpress, for some reason it’s not working when embedded into SMF:

    query_posts('cat=814&showposts=6'); ?>
    <?php while(have_posts()) : the_post(); ?>
    <div class="featuredBox">
    <a href="<?php the_permalink() ?>">
    <?php $key="featured_pic" ?>
    <?php echo '<img width="144" height="80" src="' . get_post_meta($post->ID, $key, true) . '" />' ?>
    <?php the_title(); ?>
    <?php endwhile; ?>
    <?php wp_reset_query(); ?>

    anyways yeah ^^;;; that’s my current issue.. I hope this makes more sense.. i was pretty tired when I made that other post and probably made no sense.

Viewing 1 replies (of 1 total)
  • The topic ‘Having issues integrating wordpress header into SMF’ is closed to new replies.