I found a lot of similar titles but none of them help me out of my issue.
I'm about to insert a block into the footer section on all pages so I added below code at the end of:
app/design/frontend/company/theme/layout/local.xml
just before the </layout>
tag.
<!-- Instagram Scroller -->
<default> <!-- to display on all pages -->
<!-- if name="head" exists then put in the existing tag -->
<reference name="head">
<action method="addItem"><type>skin_js</type><name>js/instashow/jquery.instashow.packaged.js</name></action>
</reference>
<reference name="footer">
<block type="core/template" name="instascroller_script" template="instascroller/script.phtml"/>
</reference>
</default>
And I put my content in
app/design/frontend/company/theme/template/instascroller/script.phtml
Then I put below code in
app/design/frontend/company/theme/template/page/html/footer.phtml
<div class="instascroller">
<?php echo $this->getBlockHtml('instascroller_script'); ?>
</div>
Then Flush the cache
---- SOLVED ----
Thanks to everyone who viewed, commented, answered this question.
First of all, I should place the <reference name="footer">
in the <default>
tag. This solved my issue of not appearing on all pages.
Secondly, I should put <action method="addItem">
in the existing <reference name="head">
tag but I mistakenly created another one.
At last, I forgot to flush the cache.
I updated my question and wish this can help others.
Again thanks to everyone.
<instagram_scroller>
to<default>
and confirmedinstascroller/script.phtml
is placed undertemplate/
andjs/instashow/jquery.instashow.packaged.js
is underskin/frontend/company/theme/
butvar_dump( $this->getBlockHtml('instascroller_script') )
still returnsstring(0) ""
.