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.

STEPS:

  1. Don't forget to use different id numbers in each accordion. For example: id="5" (1 to 10)
  2. The title goes between the
  3. The lyrics before the
  4. Place 2 accordions per posts (like the example below). Or they will mess up.

                <div class="basic" style="float:left;" id="5">
                    <a>There is one obvious advantage:</a>
                    <div>
                        <p>
                            You've seen it coming!<br/>
                            Buy now and get nothing for free!<br/>
    
                            Well, at least no free beer. Perhaps a bear,<br/>
                            if you can afford it.
                        </p>
                    </div>
                    <a>Now that you've got...</a>
                    <div>
                        <p>
                            your bear, you have to admit it!<br/>
    
                            No, we aren't selling bears.
                        </p>
                    </div>
                    <a>Rent one bear, ...</a>
                    <div>
                        <p>
                            get two for three beer.
                        </p>
                        <p>
    
                            And now, for something completely different.<br/>
                            And now, for something completely different.<br/>
                            And now, for something completely different.<br/>
                            And now, for something completely different.<br/>
                            And now, for something completely different.<br/>
                            And now, for something completely different.<br/>
    
                            And now, for something completely different.<br/>
                            And now, for something completely different.<br/>
                            Period.
                        </p>
                    </div>
            </div>
    
            <div class="basic" style="float:left;" id="6">
                    <a>There is one obvious advantage:</a>
                    <div>
                        <p>
                            You've seen it coming!<br/>
                            Buy now and get nothing for free!<br/>
    
                            Well, at least no free beer. Perhaps a bear,<br/>
                            if you can afford it.
                        </p>
                    </div>
                    <a>Now that you've got...</a>
                    <div>
                        <p>
                            your bear, you have to admit it!<br/>
    
                            No, we aren't selling bears.
                        </p>
                    </div>
                    <a>Rent one bear, ...</a>
                    <div>
                        <p>
                            get two for three beer.
                        </p>
                        <p>
    
                            And now, for something completely different.<br/>
                            And now, for something completely different.<br/>
                            And now, for something completely different.<br/>
                            And now, for something completely different.<br/>
                            And now, for something completely different.<br/>
                            And now, for something completely different.<br/>
    
                            And now, for something completely different.<br/>
                            And now, for something completely different.<br/>
                            Period.
                        </p>
                    </div>
            </div>
    

My client said is too complicated. How can I turn this into a shortcode?

EDIT

This is a jQuery accordion the title goes in the anchor tags and the lyrics before the break tags and the ID of the divs have to change eacdh time.

share|improve this question
    
IDs cannot start with numbers –  onetrickpony Mar 19 '11 at 15:01
add comment

2 Answers 2

up vote 1 down vote accepted

What you're asking for is likely to be possible using a plugin to handle the shortcode. However, I cannot work out from what you've posted what you're trying to achieve.

Can you be a bit more detailed in what you're trying to achieve? Rather than giving us the desired outcome, a bit of information on how to get there might be more useful.

Dave

share|improve this answer
    
this should really be a comments and not an answer!! –  Bainternet Mar 19 '11 at 12:31
    
Forgive me, I realise that now. However, I must be missing something as I cannot see a 'comment' link against the original post. –  thelovebug Mar 19 '11 at 12:47
    
i edited the post –  janoChen Mar 19 '11 at 16:09
add comment

i think the shortcode ultimate plugin already handles accordian shortcodes.

http://wordpress.org/extend/plugins/shortcodes-ultimate/

if not maybe this one does:

http://wordpress.org/extend/plugins/j-shortcodes/

share|improve this answer
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.