WordPress.org

Ready to get started?Download WordPress

Forums

Collapse-O-Matic
[resolved] Space after first title (16 posts)

  1. whoiscraig
    Member
    Posted 2 years ago #

    I'm trying use this plugin to set up a list of expandable items, but as you can see on my sample page, the first item has a wierd amount of space beneath it and I can't work out how to get rid of it, since none of the other items have this.

    http://www.martinandwhite.com.au/services/

    Help will be appreciated.

    http://wordpress.org/extend/plugins/jquery-collapse-o-matic/

  2. Baden
    Member
    Plugin Author

    Posted 2 years ago #

    @whoiscraig: This issue has started popping up a lot lately. Basically what is happening is WordPress is inserting/closing p tags after the first expand element. If you could, please paste the code you are using, so we can duplicate this on your test setup.

    if it's more than a few lines, feel free to send the code to: info(at)twinpictures (dot) de

    Sorry for your issues, but thanks for the feedback. Together we'll get this issue figured out!

  3. whoiscraig
    Member
    Posted 2 years ago #

    If you mean what's on the page, then its just this:

    <strong>TAXATION</strong>
    [expand title="Individuals"]A paragraph about individuals.[/expand]
    [expand title="Sole Traders"]A paragraph about sole traders.[/expand]
    [expand title="Partnerships"]A paragraph about partnerships.[/expand]
    [expand title="Companies"]A paragraph about companies.[/expand]
    [expand title="Trusts"]A paragraph about trusts.[/expand]
    [expand title="Self-Managed Super"]A paragraph about self-managed super.[/expand]
    [expand title="Funds"]A paragraph about funds.[/expand]
    [expand title="Rental Properties"]A paragraph about rental properties.[/expand]
    [expand title="Bas Preparations"]A paragraph about bas preparations.[/expand]

    Nothing special or unusual. I'm using a child of Twenty Eleven theme if that has anything to do with it.

  4. Baden
    Member
    Plugin Author

    Posted 2 years ago #

    @whoiscraig: There is something seriously wonky going on with the way WordPress is treating shortcodes with the wpautop function. The best solution we have found is to wrap your expands in a div like so:

    <strong>TAXATION</strong>
    <div>
    [expand title="Individuals"]A paragraph about individuals.[/expand]
    [expand title="Sole Traders"]A paragraph about sole traders.[/expand]
    [expand title="Partnerships"]A paragraph about partnerships.[/expand]
    </div>
  5. whoiscraig
    Member
    Posted 2 years ago #

    Thank you! I temporarily got around it by putting them all inside a UL but it was messy. The DIV solution works much better.

  6. Featherlake
    Member
    Posted 1 year ago #

    Hello,

    I am still getting this issue.

    Even if I copy and paste the code above to test it.

    <strong>TAXATION</strong>
    <div>
    [expand title="Individuals"]A paragraph about individuals.[/expand]
    [expand title="Sole Traders"]A paragraph about sole traders.[/expand]
    [expand title="Partnerships"]A paragraph about partnerships.[/expand]
    </div>
  7. Sam Lowry
    Member
    Posted 1 year ago #

    I'm getting this also- I'm getting extra space after each [expand] block.

  8. skyer2000
    Member
    Posted 1 year ago #

    Same issue here, but the <div> trick worked.

  9. dreamgrowers
    Member
    Posted 1 year ago #

    I am also getting the extra space after the first item, but In my case it also happens "randomly" and I have tried the div trick with no luck.

  10. Baden
    Member
    Plugin Author

    Posted 1 year ago #

    @dreamgrowers: link?

  11. dgrcomms
    Member
    Posted 1 year ago #

    I added the div but I am still getting the spacing
    http://66.147.244.109/~azconsum/areas-of-practice/

    I looked at the code and I can see a </br> after the heading and then a <p></p>.

    Any ideas how to remove this? Thanks

  12. Baden
    Member
    Plugin Author

    Posted 1 year ago #

    The blank space after the first expand is due to the default order in which WordPress processes content—wpautop (a WordPress core function that converts line breaks to p or br tags) is run before shortcodes are processed. If you are brave, and the above fix does not work, try changing the Execution Priority of wpautop by adding the following line to function.php:
    add_filter( 'the_content', 'wpautop',20 );

    Let us know if this works for you.

  13. dgrcomms
    Member
    Posted 1 year ago #

    It worked great, thanks! :)

  14. Bill
    Member
    Posted 1 year ago #

    I had the same problem.

    The <div></div> didn't seem to have any effect.

    I pasted the "add filter" code provided to the functions file of my child theme. This put a bit more space between the second through the last title and shrank the space after the first title so that the spacing became the same for all of them. Looks fine!

    Question: I suppose that this will work until I update the functions file in my child theme. Any ideas for alleviating me of the need to edit the code whenever this happens?

    thanks for your product and your help!

  15. competetowin
    Member
    Posted 1 year ago #

    SOLUTION:
    I found a solution that worked for me. I put all my content inside a div, gave it an id and then called the br element and gave it a display:none rule.

    Hope that fixes things for you.

    Here's example code:

    <div id="menuspacefix">
    [expand rel="menu" id="soup"]
    some soup item
    [/expand]
    [expand rel="menu" id="salad"]
    some salad item
    [/expand]
    </div>
    div#menuspacefix br {display:none;}
  16. louisJJ
    Member
    Posted 1 year ago #

    thanks competetowin!
    your workaround works!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic