1

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:

  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.

1 Answer 1

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"]'); ?>
2
  • Thanks a lot Bainternet. This has resolved the issue. Just wondering how should we disable this flash display for mobile devices.
    – SNaushadS
    Commented Oct 14, 2011 at 20:09
  • That should be a different question
    – Bainternet
    Commented Oct 15, 2011 at 9:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.