Title: [Plugin: Magento WordPress Integration] JS/CSS Function
Last modified: August 20, 2016

---

# [Plugin: Magento WordPress Integration] JS/CSS Function

 *  Resolved [jukelabs](https://wordpress.org/support/users/jukelabs/)
 * (@jukelabs)
 * [14 years ago](https://wordpress.org/support/topic/plugin-magento-wordpress-integration-jscss-function/)
 * The updates look great so far. I didn’t see any documentation about the js/css
   function. Does this still exist?
 * [http://wordpress.org/extend/plugins/magento-wordpress-integration/](http://wordpress.org/extend/plugins/magento-wordpress-integration/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [James Kemp](https://wordpress.org/support/users/jamesckemp/)
 * (@jamesckemp)
 * [13 years, 12 months ago](https://wordpress.org/support/topic/plugin-magento-wordpress-integration-jscss-function/#post-2806493)
 * Hi jukelabs,
 * You can now use it in a more convenient way :
 * `<?php the_block('head'); ?>`
 * That will display all the css/js predefined in your page.xml file. If you only
   want to get one file, rather then all of them then I recommend just hand coding
   the tags, rather than using a function.
 *  [Jonathon.Smith](https://wordpress.org/support/users/jonathonsmith/)
 * (@jonathonsmith)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-magento-wordpress-integration-jscss-function/#post-2806552)
 * The problem with just pulling in the full head is that it includes the page title
   as well as other meta tags that are set from within magento which you may not
   want on your wordpress pages.
 * What I did is added another block function to the plugin I called get_block_obj
   that rather than returning the block after calling the toHtml method just returned
   the actual block object so that I could do the following:
 * `<?php echo get_block_obj("head")->getCssJsHtml(); ?>`
 * Alternatively, you could just do the following:
 * `<?php echo jck_mwi::layout()->getBlock('head')->getCssJsHtml() ?>`
 *  Plugin Author [James Kemp](https://wordpress.org/support/users/jamesckemp/)
 * (@jamesckemp)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-magento-wordpress-integration-jscss-function/#post-2806553)
 * Good thinking Jonathon, I’ll have a look at implementing that solution for the
   next release
 *  Plugin Author [James Kemp](https://wordpress.org/support/users/jamesckemp/)
 * (@jamesckemp)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-magento-wordpress-integration-jscss-function/#post-2806554)
 * Thanks to Jonathon I have implemented a better method for getting the cssjs.
 * You can now use the folowoing code:
 * `<?php echo get_block('head', false)->getCssJsHtml(); ?>`
 * The false parameter tells MWI to not render the head as HTMl, but rather return
   it as an object.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: Magento WordPress Integration] JS/CSS Function’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/magento-wordpress-integration_1f262e.
   svg)
 * [Magento Wordpress Integration](https://wordpress.org/plugins/magento-wordpress-integration/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/magento-wordpress-integration/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/magento-wordpress-integration/)
 * [Active Topics](https://wordpress.org/support/plugin/magento-wordpress-integration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/magento-wordpress-integration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/magento-wordpress-integration/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [James Kemp](https://wordpress.org/support/users/jamesckemp/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/plugin-magento-wordpress-integration-jscss-function/#post-2806554)
 * Status: resolved