Add Piecemaker to WordPress Header

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.

Read More

Question:

  1. 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:

  1. 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);
    }
    
  2. Calling the function in theme file:

    <?php if( is_home() ) {
    display_piecemaker(array('id' => 1));
    }?>
    

Note: I am beginner with PHP.

Related posts

Leave a Reply

1 comment

  1. I’ve managed to get this working in the passed using the shortcode
    place this in your header:

    <?php echo do_shortcode('[piecemaker id="1"]'); ?>