I wish to add the Piecemaker 3D rotator to WordPress theme TwentyEleven In Header and NOT as a POST or Page. Via WordPress Plugin: Piecemaker 2
Steps:
1. Piecemaker Created with Assets
2. Tested on POST/PAGE. Getting displayed correctly.
Question:
- How to display it in Header instead Of the TwentyEleven images
(Header script removed)
What should i do to display the Piecemaker in Header.
I have tried:
-
Adding below code in Functions.php Source: Support forums
/** * Function to use piece maker outside post content * **/ function display_piecemaker($att = null){ global $pm; if(!is_array($att)){ $att = array( 'id' => $att, ); } echo $pm->replaceBooks($att); }
-
Calling the function in theme file:
<?php if( is_home() ) { display_piecemaker(array('id' => 1)); }?>
Note: I am beginner with PHP.
I’ve managed to get this working in the passed using the shortcode
place this in your header: