The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

KIA Subtitle
[resolved] Subtitle as a link of Blog Homepage? (7 posts)

  1. heyzeus909
    Posted 2 years ago #

    Thank you for a fine plugin!

    On the blog's homepage the subtitle shows up under the main title, but it isn't a link like the main title is. Considering that on this page the subtitle is actually larger than the main title, I would like to also make it a link the same way the main title is.

    How could I do this?

    Also, if you'd be so kind as to consider this as a feature request for a future version that would be wonderful.

    Here's a screen shot, if it helps:

    Or, a link to the blog itself:

  2. helgatheviking
    Plugin Author

    Posted 2 years ago #

    Sorry, but I won't be adding that as a feature. The plugin's role is only to save the subtitle and provide a way to retrieve that data. The onus is on you to display it how you wish.

    the_subtitle() has before and after parameters. You need to adjust them how you like... whether that is removing the <h2> that is in the sample or adding a link. You aren't required to use those parameters and can wrap the_subtitle() in whatever tags you'd like.

    Take a look at the FAQ.

  3. heyzeus909
    Posted 2 years ago #

    Ok, thanks...

    For anyone following along who, like me, isn't handy with code, I was able to turn the subtitle into a link using:

    <?php if( function_exists( 'the_subtitle' ) ) the_subtitle( '<h2 class="subtitle"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' ); ?>

    instead of just the code provided in the FAQ:

    if( function_exists( 'the_subtitle' ) ) the_subtitle( '<h2 class="subtitle">', '</h2>' );

    This turned the subtitle into a link, yes, but unfortunately it's not the right color now and trying to change it in the style.css didn't work.

    Better than it was, I suppose.

  4. helgatheviking
    Plugin Author

    Posted 2 years ago #

    Thanks for sharing. The link color should just be:

    h2.subtitle a {
      color: red;
  5. heyzeus909
    Posted 2 years ago #

    Thank you helgatheviking...for whatever reason, it doesn't change the color of the link. You've been gracious with your time. I'll get it sorted out somehow.

    Thanks again for the nice plugin.

  6. heyzeus909
    Posted 2 years ago #

    Unfortunately, I wasn't able to get the CSS stylesheet to cooperate with me; nothing I tried to change the color of the subtitle-link font worked.

    Using the twentyfourteen theme, the subtitle font size was fine on a desktop; however, it didn't scale on a mobile browser. On a mobile, the subtitle font ended up much larger than the original main title. That was the purpose of wanting to make the subtitle a link in the first place - because otherwise it seemed confusing to have the bigger font (the subtitle) not be the link.

    But when I was able to get the subtitle to be a link in the same manner that the main title was, it changed the subtitle font color from black to green! Not at all what I was wanting!

    Again, I wasn't able to get that taken care of in the stylesheet CSS. Probably because I'm not handy with coding.

    I used the following code in place of the supplied code found in the FAQ/Installation Instructions:

    <?php if( function_exists( 'the_subtitle' ) ) the_subtitle( '<h6 class="subtitle"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark" style="color: rgb(0,0,0)"><font color="000000">', '</font></a></h6>' ); ?>

    Obviously, if someone is following along, you'll want to change both color values (the style="color: rgb(x,x,x) & font color="XXXXXX") to the color of your choice. Black font is what I was wanting. And, yes, I took it down to an H6 from an H2. That was the compromise for the subtitle font not scaling down on a mobile browser. It still looks fine on a desktop - it just isn't as big. Which is fine for me. It still looks like a subtitle because of the placement and bolder font.

    helgatheviking, if you'd be so kind as to look over the code to make sure I didn't mess anything up, I'd be grateful.

  7. helgatheviking
    Plugin Author

    Posted 2 years ago #

    If my CSS didn't work, then you have some styles in your stylesheet that are more specific than what I provided.

    Your new approach strikes me as unnecessary, you just need to find the right CSS rules. This definitely goes beyond the scope of the plugin, so I would suggest asking at http://www.stackoverflow.com.

    I'm sure it is an easy fix, but it is impossible without seeing your theme's stylesheet or better still, your live site. If you have Firefox or Chrome you can use Firebug or Developer Tools to inspect the subtitle link element and see where the style is coming from.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • KIA Subtitle
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.