Title: Span Class and CSS
Last modified: July 8, 2018

---

# Span Class and CSS

 *  Resolved [atomikpop](https://wordpress.org/support/users/atomikpop/)
 * (@atomikpop)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/span-class-and-css/)
 * I have manually entered the secondary title in a custom featured post widget.
   However, I cannot style the output. I believe I need to create a span class, 
   but I need to know what file to create it in — should I edit functions.php or
   the php file associated with the custom widget?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fspan-class-and-css%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [thaikolja](https://wordpress.org/support/users/thaikolja/)
 * (@thaikolja)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/span-class-and-css/#post-10484965)
 * Hi [@atomikpop](https://wordpress.org/support/users/atomikpop/),
 * First off, could you tell me what you mean by “manually entered the secondary
   title in a custom featured post widget”? The shortcode? A PHP function? I need
   to know that.
 *  Thread Starter [atomikpop](https://wordpress.org/support/users/atomikpop/)
 * (@atomikpop)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/span-class-and-css/#post-10489559)
 * I used echo get_secondary_title.
 * I’d prefer to use a div class but when I try to create a div it breaks my site.
 *  Plugin Author [thaikolja](https://wordpress.org/support/users/thaikolja/)
 * (@thaikolja)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/span-class-and-css/#post-10491698)
 * Where did you use that? In the .php file of the widget?
 * If HTML tags mess up your site, it might be that you either forgot to close the
   tag `(</...)` or that you gave it a class or ID that has already been in use.
 * Some screenshots and the actual code would help giving you more accurate support.
 *  Thread Starter [atomikpop](https://wordpress.org/support/users/atomikpop/)
 * (@atomikpop)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/span-class-and-css/#post-10492828)
 * Yes, I have an echo statement in the php file of the widget.
 * I have tried inline style, span class, and div class.
 * I have saved the div code here – [https://atomikpop.com/farel](https://atomikpop.com/farel)
 * Nothing seems to work.
 *  Thread Starter [atomikpop](https://wordpress.org/support/users/atomikpop/)
 * (@atomikpop)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/span-class-and-css/#post-10496229)
 * I have created a class php file that extends the Genesis Featured Post widget(
   see [https://sridharkatakam.com/relocate-titles-genesis-featured-posts-widgets-output/](https://sridharkatakam.com/relocate-titles-genesis-featured-posts-widgets-output/)).
 * When I use echo the_secondary_title() it works but has no style.
 * I have tried the following:
 * echo ‘<span style=”color: blue;”>’the_secondary_title()'</span>’;
 * However, the echo command immediately above crashes my site.
 *  Thread Starter [atomikpop](https://wordpress.org/support/users/atomikpop/)
 * (@atomikpop)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/span-class-and-css/#post-10499775)
 * Finally got it to work using:
 * echo “<div class=’secondary-title’>”. get_secondary_title() .”</div>”;
 * Also found an error in my style.css file that may have been causing issues.
 * Thanks for your assistance , Kolja – I appreciate your time.
    -  This reply was modified 7 years, 10 months ago by [atomikpop](https://wordpress.org/support/users/atomikpop/).
      Reason: Corrected a typo
 *  Plugin Author [thaikolja](https://wordpress.org/support/users/thaikolja/)
 * (@thaikolja)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/span-class-and-css/#post-10506222)
 * Hi [@atomikpop](https://wordpress.org/support/users/atomikpop/),
 * Great to hear you’ve resolved this issue. You were missing the dot-connectors,
   right?
 * If you need any more assistant, please let me know.
 *  Thread Starter [atomikpop](https://wordpress.org/support/users/atomikpop/)
 * (@atomikpop)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/span-class-and-css/#post-10507141)
 * Yes, and some of the tutorials I read on various help sites seemed to provide
   conflicting advice regarding double-quotes versus single-quotes. The dot-connectors
   and double-quotes were what I needed to use:
 * echo “<div class=’secondary-title’>”. get_secondary_title() .”</div>”;
 * Next, I may want to remove the secondary title from my single-post pages. If 
   I need help with that I will open another support request. This has been a very
   educational exercise — I am a beginner at coding — and I really appreciate your
   help.
 *  Plugin Author [thaikolja](https://wordpress.org/support/users/thaikolja/)
 * (@thaikolja)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/span-class-and-css/#post-10512975)
 * Of course, feel free to submit your support question at any time and I’ll try
   to help as much as I can 🙂

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

The topic ‘Span Class and CSS’ is closed to new replies.

 * ![](https://ps.w.org/secondary-title/assets/icon.svg?rev=2520363)
 * [Secondary Title](https://wordpress.org/plugins/secondary-title/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/secondary-title/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/secondary-title/)
 * [Active Topics](https://wordpress.org/support/plugin/secondary-title/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/secondary-title/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/secondary-title/reviews/)

## Tags

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

 * 9 replies
 * 2 participants
 * Last reply from: [thaikolja](https://wordpress.org/support/users/thaikolja/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/span-class-and-css/#post-10512975)
 * Status: resolved