Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
2.2k views
in Q2A Core by

Hi, I am trying to wrap my q2a site by wordpress header and footer according to the solution provided by noah here. But, I am receiving a blank page, no wordpress header or footer, and my q2a site simply just vanish. I don't even receive any php error.

Any idea?

Regards.

by
I just wonder if anyone can help you without giving more detail or code what you have used in your qa theme file..
by
If you have read my post(!) as I mentioned above, a detail explanation on how to wrap wordpress header and footer provided by NOAY on some other post, which I was following. I can recall, previously the default q2a theme was working cool, but current default isn´t working.
Link to noah´s post:
http://www.question2answer.org/qa/9773/wordpress-theme-integration?show=9773#q9773
by
I have gone through that code. My intention was to posting your code or other specific information about your own theme. Anyway..
by
I am using a themeforest´s theme called striking. Please see below the header and footer code. Regards.

2 Answers

0 votes
by

Header code:

<?php
/**
 * The Header for our theme.
 *
 * Displays all of the <head> section
 *
 * @package Striking
 */
?><!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" <?php language_attributes(); ?>> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" <?php language_attributes(); ?>> <!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title><?php echo theme_generator('title'); ?></title>
<?php if($custom_favicon = theme_get_option('general','custom_favicon')) { ?>
<link rel="shortcut icon" href="<?php echo theme_get_image_src($custom_favicon); ?>" />
<?php } ?>

<!-- Feeds and Pingback -->
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS2 Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<?php wp_head(); ?>

<!--[if IE 6 ]>
    <link href="<?php echo THEME_CSS;?>/ie6.css" media="screen" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="<?php echo THEME_JS;?>/dd_belatedpng-min.js"></script>
    <script type="text/javascript" src="<?php echo THEME_JS;?>/ie6.js"></script>
<![endif]-->
<!--[if IE 7 ]>
<link href="<?php echo THEME_CSS;?>/ie7.css" media="screen" rel="stylesheet" type="text/css">
<![endif]-->
<!--[if IE 8 ]>
<link href="<?php echo THEME_CSS;?>/ie8.css" media="screen" rel="stylesheet" type="text/css">
<![endif]-->
<!--[if IE]>
    <script type="text/javascript" src="<?php echo THEME_JS;?>/html5.js"></script>
<![endif]-->
<?php
    if(theme_get_option('font','cufon_enabled')){
        theme_add_cufon_code();
    }
?>
<script type="text/javascript">
var image_url='<?php echo THEME_IMAGES;?>';
<?php
    if(theme_get_option('advanced','restrict_colorbox')){
        echo 'var restrict_colorbox = true;';
    }
    $grayscale_animSpeed = theme_get_option('advanced','grayscale_animSpeed');
    $grayscale_outSpeed = theme_get_option('advanced','grayscale_outSpeed');
    if($grayscale_animSpeed != '1000'){
        echo 'var grayscale_animSpeed='.$grayscale_animSpeed.';';
    }
    if($grayscale_outSpeed != '1000'){
        echo 'var grayscale_outSpeed='.$grayscale_outSpeed.';';
    }
?>
</script>
<?php
    if(theme_get_option('general','analytics') && theme_get_option('general','analytics_position')=='header'){
        echo stripslashes(theme_get_option('general','analytics'));
    }
?>
</head>
<body <?php body_class(); ?>>
<header id="header">
    <div class="inner">
<?php if(theme_get_option('general','display_logo') && $custom_logo = theme_get_option('general','logo') ):
?>
<div id="logo">
    <a href="<?php echo home_url( '/' ); ?>"><img class="ie_png" src="<?php echo theme_get_image_src($custom_logo); ?>" alt="<?php bloginfo('name'); ?>"/></a>
<?php if(theme_get_option('general','display_site_desc')){
        $site_desc = get_bloginfo( 'description' );
        if(!empty($site_desc)):?>
            <div id="site_description"><?php bloginfo( 'description' ); ?></div>
<?php endif;}?>
        </div>
<?php else:?>
        <div id="logo_text">
            <a id="site_name" href="<?php echo home_url( '/' ); ?>"><?php bloginfo('name'); ?></a>
<?php if(theme_get_option('general','display_site_desc')){
        $site_desc = get_bloginfo( 'description' );
        if(!empty($site_desc)):?>
            <div id="site_description"><?php bloginfo( 'description' ); ?></div>
<?php endif;}?>
        </div>
<?php endif; ?>
<?php $top_area_type = theme_get_option('general','top_area_type');
    switch($top_area_type){
        case 'html':
            if(theme_get_option('general','top_area_html')){
                echo '<div id="top_area">';
                echo str_replace(array('[raw]','[/raw]'),'',do_shortcode(wpml_t(THEME_NAME, 'Top Area Html Code', stripslashes( theme_get_option('general','top_area_html') ))));
                echo '</div>';
            }
            break;
        case 'wpml_flags':
            echo theme_generator('wpml_flags');
            break;
        case 'widget':
            echo '<div id="top_area">';
            dynamic_sidebar(__('Header Widget Area','striking_admin'));
            echo '</div>';
            break;
    }
?>
        <?php echo theme_generator('menu');?>
    </div>
</header>

 

0 votes
by

Footer code:

<?php
/**
 * The template for displaying the footer.
 *
 * @package Striking
 */

if(theme_get_option('footer','footer') || theme_get_option('footer','sub_footer')):
    wp_reset_query();
    if(is_front_page()){
        global $home_page_id;
        $footer_color = get_post_meta($home_page_id, '_footer_background_color', true);
    }else{
        $footer_color = get_post_meta(get_queried_object_id(), '_footer_background_color', true);
    }
    if(!empty($footer_color) && $footer_color != "transparent"){
        $footer_color = ' style="background-color:'.$footer_color.'"';
    }else{
        $footer_color = '';
    }
if(theme_get_option('footer','stricky_footer')){
    echo '<div><div>';
}
?>
<footer id="footer"<?php echo $footer_color;?>>
<?php if(theme_get_option('footer','footer')):?>
    <div id="footer_shadow"></div>
    <div class="inner">

 

<div class="clearboth"></div>
    </div>
<?php endif;?>
<?php if(theme_get_option('footer','sub_footer')):?>
    <div id="footer_bottom">
        <div class="inner">
            <div id="copyright"><?php echo wpml_t(THEME_NAME, 'Copyright Footer Text',stripslashes(theme_get_option('footer','copyright')))?></div>
<?php
    $footer_right_area_type = theme_get_option('footer','footer_right_area_type');
    switch($footer_right_area_type){
        case 'html':
            echo '<div id="footer_right_area">';
            echo do_shortcode(wpml_t(THEME_NAME, 'Footer Right Area Html Code',stripslashes( theme_get_option('footer','footer_right_area_html') )));
            echo '</div>';
            break;
        case 'menu':
            wp_nav_menu(array(
                'theme_location' => 'footer-menu',
                'container' => 'nav',
                'container_id' => 'footer_menu',
                'fallback_cb' => ''
            ));
            break;
        case 'widget':
            echo '<div id="footer_right_area">';
            dynamic_sidebar(__('Sub Footer Widget Area','striking_admin'));
            echo '</div>';
            break;
    }
?>
            <div class="clearboth"></div>
        </div>
    </div>
<?php endif;?>
</footer>
<?php
if(theme_get_option('footer','stricky_footer')){
    echo '</div></div>';
}
endif;?>
<?php
    wp_footer();
    theme_add_cufon_code_footer();
    if(theme_get_option('general','analytics') && theme_get_option('general','analytics_position')=='bottom'){
        echo stripslashes(theme_get_option('general','analytics'));
    }
    if(theme_get_option('general','custom_js')){
        echo stripslashes(theme_get_option('general','custom_js'));
    }
?>
</body>
</html>

by
All you have to do is copy/paste header and footer. Noah gave a nice mplementation. Make sure you are closing all tags.
You can try it by using Twenty-Eleven Theme the way he did it, and see it works for you. Also try it with other vesion.
...