I have included wordpress into magento in order to use wordpress functions by adding following lines to magentos index.php
.
define('WP_USE_THEMES', false);
require_once MAGENTO_ROOT . '/blog/wp-load.php';
But this code somehow injects wordpress wp_head
and wp_footer
code in header and footer of magento files.
This is my magento template file (2columns-left.phtml
).
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
</body>
</html>
but output is
<!DOCTYPE html>
<html lang="en">
<head>
<style type="text/css">
img.wp-smiley,
img.emoji {
display: inline !important;
border: none !important;
box-shadow: none !important;
height: 1em !important;
width: 1em !important;
margin: 0 .07em !important;
vertical-align: -0.1em !important;
background: none !important;
padding: 0 !important;
}
</style>
<style type="text/css">
.mobile-menu {
position: -webkit-sticky;
position: -moz-sticky;
position: -ms-sticky;
position: -o-sticky;
position: sticky;
}
</style>
</head>
<body>
<script type='text/javascript' src='https://SITNAME.com/blog/wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>
<script type='text/javascript' src='https://SITNAME.com/blog/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.4.1'></script>
</body>
</html>
Cant understand how can wp inject html into header and footer without calling any php function (Note style and script tags). Even I disabled JS too. Any help highly appreciated.
Edit:
This is not magento specific. I include wp-load.php
into an independent php script and wordpress changes output. Adds style and script in header and before body ends.
2
Answers
I think you want WordPress integration with Magento then you need to use fishpig extension follow this URL
https://fishpig.co.uk/magento/wordpress-integration/
@mysterious could you try this in your functions.php and get back to us?