Jump to content

Add Prestashop's header/footer (1.6.0.14) to Wordpress 4.4.2 with Twenty Fifteen theme


Recommended Posts

Hello,

 

I just would like to add the Prestahop's header and footer to my Wordpress blog (situated in my_site/blog).

I've read many things about that, which may work with other themes that Twenty Fifteen, such as (in header.php)...

<?php
require_once(dirname(__FILE__).’/../../../../config/config.inc.php’);
require_once(dirname(__FILE__).’/../../../../header.php’);
?>

... or (footer.php) ...

<?php
require_once(dirname(__FILE__).’/../../../../config/config.inc.php’);
require_once(dirname(__FILE__).’/../../../../footer.php’); 
?>

... or (header.php)...

require_once(dirname(__FILE__).’/../../../../config/config.inc.php’);
$controller = new FrontController();
$controller->displayHeader();

... but that doesn't work with my theme.

 

What should I do please?

 

Thanks a lot,

Edited by prestacar (see edit history)
Link to comment
Share on other sites

Prestashop doesn't use those files, unless you created them from scratch, they are deprecated.

it might be more complex than you think, as you'll have to fetch header.tpl and footer.tpl, which are located in the theme folder. That given, you'd also have to process hooks.
I'd create custom files for that.

 

Link to comment
Share on other sites

Thanks for your quick answer.

 

 

I hope this could be usefull :

 

So, I've added those lines to index.php ...

require_once(dirname(__FILE__).'/../../../../config/config.inc.php');
require_once(dirname(__FILE__).'/../../../../header.php');

... and added at the end if the file...

<?php $controller->displayFooter(); ?>

... and I also changed ...

if ( is_front_page() && is_home() ) : ?>
	<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<?php else : ?>
	<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
<?php endif;

... to custom lines ...

if ( is_front_page() && is_home() ) : ?>
	<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php header_image(); ?>" class="header-image" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" /></a></h1>
<?php else : ?>
	<p class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php header_image(); ?>" class="header-image" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" /></a></p>
<?php endif

The page displays now Prestashop header and footer, with some bugs for the left sidebar and a footer using 100% of the page width.

 

I have to enhance that. I hope I would be able to do.

Edited by prestacar (see edit history)
Link to comment
Share on other sites

  • 2 months later...

Hi Prestacar,

 

I've seen that you've been able to integrate your wordpress in PS 1.6. I'm trying to do so but I get a blank page. Could you show me please the content of your index.php file in Wordpress

Thank you

Hello,

I found the issue was one of my modules

Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...