WordPress.org

Ready to get started?Download WordPress

Forums

DivUp Content
Apply custom class to all divs (2 posts)

  1. whatachamp
    Member
    Posted 2 years ago #

    Hi Sebastian.
    Thanks for creating this handy plugin.

    I am wondering how to apply a class to all the divs (not the wrapper though).
    I saw your notes on how to apply a custom class to the first and other divs, but it doesn't apply it to the last div.

    I edited the php with the class I wanted on all divs, and that works, but I need to use multiple instances of the plugin in the site and they all don't need my custom class.
    So would rather control the custom classes from the CMS.

    Many thanks

    http://wordpress.org/extend/plugins/divup-content/

  2. Themeover
    Member
    Plugin Author

    Posted 2 years ago #

    Hi there,

    You should be able to apply a class to the last div. I just did the following test:

    I entered this dummy content into the WordPress text editor:

    Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page.
    
    [divup class='class-A, class-B']
    
    Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page.
    
    [divup class='class-C']
    
    Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page.

    And it resulted in the following output:

    <div class="divup div-1 div-odd first class-A">
    <p>Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page.</p>
    </div>
    <div class="divup div-2 div-even class-B">
    <p>Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page.</p>
    </div>
    <div class="divup div-3 div-odd mul-3 last class-C">
    <p>Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page. Some content on this page.</p>
    </div>

    Notice how adding class-C to the last [divup] shortcode resulted in the last div having the class "class-C". if this isn't happening for you, please could you post a link to the website you are working on so that I can troubleshoot this further.

    Thanks,

    Sebastian

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.