Title: Using span style in shortcode
Last modified: July 18, 2017

---

# Using span style in shortcode

 *  Resolved [Richard Slade](https://wordpress.org/support/users/raslade/)
 * (@raslade)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/using-span-style-in-shortcode/)
 * Hi Guido
 * I’m looking at styling some of the headings so that they appear in a different
   colour depending on which category is selected. I’ve tried adding a span style
   in the shortcode but no luck. Do you know a way to implement or is it not impossible?
 * Thanks
    Richard

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

 *  Plugin Author [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/using-span-style-in-shortcode/#post-9330947)
 * Hi Richard,
 * In next update I will wrap variables date, time and location in span tags, so
   you can apply custom CSS to them, instead of to whole labels. Is that what you
   want?
 * Currently I’m trying to solve [another issue](https://wordpress.org/support/topic/custom-post-type-pagination-on-homepage/),
   regarding pagination on homepage.. So when I have a fix, I will update plugin
   asap.
 * Guido
 *  Plugin Author [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/using-span-style-in-shortcode/#post-9330963)
 * Hi again,
 * But if you want to apply custom CSS depending on which event category page visitor
   is, I advice you to use the body class.. because an unique class is added to 
   the body class.
 *     ```
       <body class="archive tax-event_cat term-my-category etc etc">
       ```
   
 * The “term” = your event category.
 * Guido
 *  Thread Starter [Richard Slade](https://wordpress.org/support/users/raslade/)
 * (@raslade)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/using-span-style-in-shortcode/#post-9330977)
 * Hi Guido
 * Yes that could work, hopefully if it allows customisation between different categories
   on the same page.
 * With the body class option – is this before the shortcode brackets?
 * Thanks
    Richard
 *  Thread Starter [Richard Slade](https://wordpress.org/support/users/raslade/)
 * (@raslade)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/using-span-style-in-shortcode/#post-9331065)
 * Ok i’ve got a simpler option. I’ve wrapped the shortcode with a div and targeted
   the right label with CSS. Sorted.
 * Thanks
    Richard
 *  Plugin Author [Guido](https://wordpress.org/support/users/guido07111975/)
 * (@guido07111975)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/using-span-style-in-shortcode/#post-9332103)
 * Hi Richard,
 * In this situation I prefer using the body to add custom CSS.
 * Let’s say you have a category (a slug) called “my-category” and you want to change
   the colour of the Time label… this should work:
 *     ```
       .term-my-category .vsel-meta-time {color:#cc0000;}
       ```
   
 * After my theme-update you can also add custom CSS to the time variable itself:
 *     ```
       .term-my-category .vsel-meta-time span {color:#cc0000;}
       ```
   
 * Guido
 *  Thread Starter [Richard Slade](https://wordpress.org/support/users/raslade/)
 * (@raslade)
 * [8 years, 10 months ago](https://wordpress.org/support/topic/using-span-style-in-shortcode/#post-9332142)
 * Thanks Guido
 * Yes this is what I’ve ended up doing for now but a span option would be very 
   useful.
 * Thanks
    Richard

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

The topic ‘Using span style in shortcode’ is closed to new replies.

 * ![](https://ps.w.org/very-simple-event-list/assets/icon-256x256.png?rev=1415754)
 * [VS Event List](https://wordpress.org/plugins/very-simple-event-list/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/very-simple-event-list/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/very-simple-event-list/)
 * [Active Topics](https://wordpress.org/support/plugin/very-simple-event-list/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/very-simple-event-list/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/very-simple-event-list/reviews/)

## Tags

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

 * 6 replies
 * 2 participants
 * Last reply from: [Richard Slade](https://wordpress.org/support/users/raslade/)
 * Last activity: [8 years, 10 months ago](https://wordpress.org/support/topic/using-span-style-in-shortcode/#post-9332142)
 * Status: resolved