Support » Plugin: Magento WordPress Integration » [Plugin: Magento WordPress Integration] call blocks for only one page

  • Resolved pimpinnick



    first off, thanks for the plugin. Now for my question:

    I was wondering if you could give me a hint on how to integrate blocks from magento on just one page? I have multiple pages (home, shop, blog, …) and I would like to only have the magento blocks on the shop page. Not quite sure how to go about it. Are there conditional tags or how do I not have the blocks globally for my page.

    Any help is appreciated.



Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author jamesckemp


    Hi Nick,

    You’ll want to use WordPress conditional tags in your templates, for example:

    if(is_page('page-slug')) { the_block('your-block'); }


    if(is_page(25)) { the_block('your-block'); }

    where 25 is the page id. This will mean the block only shows on that page.

    Hey James,

    thanks for your answer. I will have to be a complete noob about this:

    I understand enough php to have a grasp of the syntax and what it does. However, I don’t know where I have to put that line of code. I tried integrating it into a custom page template but to no avail. Any recommendations? Again, I appreciate your help.


    Plugin Author jamesckemp


    If you only ever want the block to appear on said template, you should just be able to put:

    <?php the_block('your-block'); ?>

    where you want it to appear, if that doesn’t work, paste some code and I’ll take a look!


    thanks for the advice. I figured it out by now. And thanks again for the plugin!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: Magento WordPress Integration] call blocks for only one page’ is closed to new replies.