Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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