SMF Header and Menu Wordpress Integration [Solved]

Started by Audiobreeze, January 17, 2009, 08:26:18 PM

Previous topic - Next topic

Audiobreeze

I feel that I'm so close to finishing the integration of the header and footer, but I ran into what I believe is a minor hurdle. I follow Daniel15's guide to SMF integration (http://www.simplemachines.org/community/index.php?topic=145838.0) and I was able to set it up according to his instructions. I know this because I pasted the example header code in his tutorial into my header.php file and it displayed properly. When I paste my code from my theme's header.php file, my forum displays my themes background, but the header image and navigation menu for the theme are not present; nor is the forum itself. I am also seeing this error in a very large font at the top: Fatal error: Call to undefined function bloginfo() in /home/press/public_html/forum/header.php on line 4.

Here is the code in my header.php file in the forum directory:
<div id="container">

<div id="header" class="clearfix">
   <div id="title"><a href="<?php bloginfo('url'); ?>"><?php bloginfo('title'); ?></a></div>
    <div id="desc"><?php bloginfo('description'); ?></div>
</div>

<div id="menu" class="clearfix">
<ul>
   <?php //A link back to the homepage ... unlesss the user chose to omit it ?>
   <?php if($wp_theme_options['exclude_pages']['0'] != 'home') { ?>
   <li class="home <?php if ( is_home() ) { echo "current_page_item"; } ?>"><a href="<?php echo get_settings('home'); ?>"><?php _e("Home"); ?></a></li>
   <?php } ?>
    <?php //Lists pages, excludes pages selected in theme options ?>
    <?php if($wp_theme_options['exclude_pages']) $exclude = implode(",", $wp_theme_options['exclude_pages']); ?>
    <?php $my_pages = "title_li=&depth=2&sort_column=menu_order&exclude=".$exclude; wp_list_pages($my_pages); ?>
</ul>
</div>

Can anyone shine some light here?

Thanks

Audiobreeze

#1
I looked through everything again, my hypothesis here is that the code in my header.php file is looking to call another php file to see what to input for bloginfo() . If this is correct, then I imagine I need to create a php file declaring the values for bloginfo() as well as other functions within the <?php tags. Can anyone help me with writing this new php file?

Edit: Fixed a spelling error

Audiobreeze

Update: Ok, I spent a couple of hours looking through the php files in my wordpress directory as well as my themes directory to find a file that I can call for the functions in my header.php file in the forum directory. No luck with that.

Audiobreeze

#3
Note: I am using the iCompany / iCar theme from hxxp:ithemes.com [nonactive] .

Ok, Fantastic news! I have solved this issue and it wasn't terribly difficult as I figured anyway. I believe the problem to be that the header.php file in my forum directory was needing to call other files to identify what the functions within the code were. I solved this with a work around by looking at the source code of my home page through Mozilla. I scrolled down to the section containing the <div id="menu"... and took a look at how it was being displayed. Unlike my original code in the header.php file, all of the menu button links are displayed here. This makes it easy for the header file to display the menu bar.

Here is the source code I am now displaying in my header.php file in the forum directory:

<div id="container">



<img src="hxxp:yoursite.com/wp-content/uploads/2009/01/header.png [nonactive]" alt="" />

<div id="menu" class="clearfix">
<ul>
         <li class="home "><a href="hxxp:yoursite.com [nonactive]">Home</a></li>
               <li class="page_item page-item-2"><a href="hxxp:yoursite.com/about [nonactive]" title="About">About</a></li>
<li class="page_item page-item-16 current_page_item"><a href="hxxp:yoursite.com/forum [nonactive]" title="Forum">Forum</a></li>

<li class="page_item page-item-108"><a href="hxxp:yoursite.com/contact [nonactive]" title="Contact">Contact</a></li>
</ul>
</div>

---You will obviously have to remove the word 'yoursite' and replace it with your website domain name. You'll also notice that I am displaying my header image within a simple image tag. This is all that is needed since the image is not linking to anything, nor is it involved with any functions.

Hope this helps some of you.

Advertisement: