Title: Custom container div classes
Last modified: August 21, 2016

---

# Custom container div classes

 *  Resolved [Matt Bedford](https://wordpress.org/support/users/matt-bedford/)
 * (@matt-bedford)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/custom-container-div-classes/)
 * Hi There,
 * This a fantastic plugin but I wondered whether you’d consider a few extras. I
   need to be able to specify a custom class on the containing div. So it would 
   by possible to serve html like so `class="widget posts-in-sidebar my-custom-class"`.
   Also, the ability to select specific posts to be featured would be great.
 * Do you currently have plans to implement any of the above?
 * Thanks,
    Matt
 * [http://wordpress.org/plugins/posts-in-sidebar/](http://wordpress.org/plugins/posts-in-sidebar/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Aldo Latino](https://wordpress.org/support/users/aldolat/)
 * (@aldolat)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/custom-container-div-classes/#post-4413070)
 * Hi Matt,
    thanks for the kind words! 🙂
 * The container div can’t be modified because it’s outside of the plugin so I cannot
   add an option field. You could add your custom class in the source of the plugin,
   but you’ll have to re-add it at every plugin update.
 * About the second question, this is something I would add to a future release.
 * Bye.
 *  Plugin Author [Aldo Latino](https://wordpress.org/support/users/aldolat/)
 * (@aldolat)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/custom-container-div-classes/#post-4413077)
 * Matt,
    [in this thread](http://wordpress.org/support/topic/custom-css-class?replies=2#post-4717635)
   I wrote something that could be useful for you. Take a look there.
 * Let me know.
 *  Plugin Author [Aldo Latino](https://wordpress.org/support/users/aldolat/)
 * (@aldolat)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/custom-container-div-classes/#post-4413122)
 * Matt,
    in version 1.15 you will be able to select posts by ID. The new version
   will be published in the next hours.
 * Bye.
 *  Thread Starter [Matt Bedford](https://wordpress.org/support/users/matt-bedford/)
 * (@matt-bedford)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/custom-container-div-classes/#post-4413142)
 * That’s great Aldolat thank you so much!
 * I appreciate your advice regarding the custom class too but it’s not quite what
   I’m after. I’ would like to be able to set a unique class from the widget options
   panel so each instance of the widget can be targeted via different css. Could
   something like this work?
 *     ```
       <div id="pis_posts_in_sidebar-2" class="widget posts-in-sidebar">
            <div class="my-class">
            </div>
       </div>
       ```
   
 * Something else that would be useful without further complicating the admin would
   be automatically generated classes on the categories links. This would allow 
   for colour coding.
 *     ```
       <p class="pis-categories-links">
       <a href="http://localhost/lacuna-project/category/design/" titles=View all posts in Design" class="design">Design</a>
       <a href="http://localhost/lacuna-project/category/travel/" title="View all posts in Travel" class="travel">Travel</a>
       </p>
       ```
   
 * Again, to keep the admin simple perhaps some of this code could be combined into
   the parent div rather than specifying a unique class in the admin?
 *     ```
       <div id="pis_posts_in_sidebar-2" class="widget posts-in-sidebar">
            <div class="design-travel>
            </div>
       </div>
       ```
   
 * What do you think? Maybe I’m being a bit too specific to my own requirments? 
   lol 🙂
 * Cheers,
    Matt
 *  Plugin Author [Aldo Latino](https://wordpress.org/support/users/aldolat/)
 * (@aldolat)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/custom-container-div-classes/#post-4413145)
 * Hey Matt, what about targeting each instance via the CSS #id selector? For example:
 *     ```
       div#pis_posts_in_sidebar-2 {
       background-color: orange;
       }
       ```
   
 *  Thread Starter [Matt Bedford](https://wordpress.org/support/users/matt-bedford/)
 * (@matt-bedford)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/custom-container-div-classes/#post-4413148)
 * Hi Aldolat,
 * For what I’m try to achieve there needs to be some relationship between the unique
   class/id and the category as I’d like categories to be colour coded. Being able
   to set the class in the options panel would make this possible but a more automated
   approach might be better from an administration point of view which is why I 
   thought of combing relevant categories into the naming convention. This might
   be too specific to my own needs though?
 * Thank,
    Matt
 *  Plugin Author [Aldo Latino](https://wordpress.org/support/users/aldolat/)
 * (@aldolat)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/custom-container-div-classes/#post-4413149)
 * I just committed a new development version (1.16-dev) on GitHub. You can download
   the zip archive [from this page](https://github.com/aldolat/posts-in-sidebar).
 * Replace the files on your test site. You’ll find a new field in the “Extras” 
   section of the widget panel, named “Custom CSS Class for container”: just enter
   the class and a new div will be created, just as you suggested here. The new 
   div container is created only if a user enter something in this field.
 * Let me know, please.
 *  Plugin Author [Aldo Latino](https://wordpress.org/support/users/aldolat/)
 * (@aldolat)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/custom-container-div-classes/#post-4413268)
 * Hi Matt,
    the plugin has been updated to version 1.16, that contains this new
   feature.
 * Bye.
 * P.S.
    Please, mark this thread as resolved, if this fits your needs.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Custom container div classes’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/posts-in-sidebar_aed6f1.svg)
 * [Posts in Sidebar](https://wordpress.org/plugins/posts-in-sidebar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/posts-in-sidebar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/posts-in-sidebar/)
 * [Active Topics](https://wordpress.org/support/plugin/posts-in-sidebar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/posts-in-sidebar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/posts-in-sidebar/reviews/)

## Tags

 * [request](https://wordpress.org/support/topic-tag/request/)

 * 8 replies
 * 2 participants
 * Last reply from: [Aldo Latino](https://wordpress.org/support/users/aldolat/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/custom-container-div-classes/#post-4413268)
 * Status: resolved