Before you ask please READ THIS

Subtitles for blog posts

edited April 2014 in Beach Please Posts: 111
Hi!

My blog is bilingual, but I can only (or just want to) write a headline in one language.
Is there a chance to add subtitles to a blog article like on pages?

(see attached file)

Thanks!
Subtitles on blog.jpg
1200 x 649 - 123K

Comments

  • AirAir
    edited April 2014 Posts: 10,970
    Hello

    Yes it is possible:
    1. go to advance/meta.php line ~27 change:

    array(
    'name' => '',
    'type' => 'fieldset',
    ),
    to

    array(
    'name' => '',
    'type' => 'fieldset',
    ),
    array(
    'name' => __be( 'Subtitle' ),
    'desc' => '',
    'id' => 'subtitle',
    'default' => '',
    'type' => 'input'
    ),
    2. Go to content.php line~11 change:
    a13_top_image_video( true, $media_width );
    
    to(updated part)
    $s = get_post_meta(get_the_ID(), '_subtitle', true);
    if(strlen($s)) echo'<h3 class="subtitle">'.$s.'</h3>';
    
    a13_top_image_video( true, $media_width );
    
    Done:-)

    With regards.
    Post edited by Air on
  • Posts: 111
    Awesome! Thank you!

    Is it also possible to display the subtitles…

    a) …in another color (it’s more obvious when it’s grey e.g. like on the pages)?
    b) …also when the post is opened?

    (see attached file)

    Thanks!
    Bild 003.jpg
    1960 x 848 - 271K
  • AirAir
    Posts: 10,970
    You have to know we don't do such modifications here. I just gave you this one cause it was harder part but fast to do. You will have to work it out by yourself or hire someone.

    With regards.
  • Posts: 111
    Okay. Thanks.
  • AirAir
    Posts: 10,970
    Okay, I will give you code:-)
    I have changed previous code (added class to subtitle) so update your also.

    Add such custom CSS to change styling of subtitle

    h3.subtitle {
    color: #B2B2B2;
    font-weight: normal;
    }
    Next lets edit single post. Go to advance/utilities.php line ~980 and change:
    
            if(is_single()){
                a13_post_nav();
            }
    to
    
            if(is_single()){
                a13_post_nav();
                $s = get_post_meta(get_the_ID(), '_subtitle', true);
                if(strlen($s)) echo'<h3 class="subtitle">'.$s.'</h3>';
            }
    This should do it:-)

    With regards.
  • Posts: 111
    You rock!
    Displaying the subs in single posts works perferctly!
    The code for the custom CSS unfortunately has no effect. I also tried the code without any further code I added. We talk about the custom CSS box in "Appearance", right?

    I just sent you a coffee. ;)
  • AirAir
    Posts: 10,970
    Thanks for Coffee ;-)

    Yes, you should insert it there. I have been on your site now and I don't see any changes - have you done it already ? Maybe some cache plugin?

    with regards.
  • Posts: 111
    …I just answered the other thread (background color of blog). I forgot to send it. :)

    Back to this topic:

    This code doesn’t seem to have any affect:

    h3.subtitle {
    color: #B2B2B2;
    font-weight: normal;
    }


    The single post subtitles work, but I didn’t have the time yet to add them everywhere.

    Cache is empty.
  • AirAir
    edited April 2014 Posts: 10,970
    I checked and it works on single post http://blog.tupamaros-film.de/gewinnt-freikarten-fuers-lost-cabaret/
    I also see that you changed css to match h2 so no wonder it doesn't work on blog, cause there you use h3. Also you didn't add class subtitle to blog subtitles like I said before. Check http://support.apollo13.eu/vanilla/post/editcomment/8632

    Track your changes and you will be fine :-)

    Read whole topic carefully again and you will get your results :-)

    With regards.
    Post edited by Air on
  • Posts: 111
    Oh, yes. I read over the "updated" part of your previous post.
    Rock and roll: Now it works!
    Awesome!
    Thank you!

    (The link http://support.apollo13.eu/vanilla/post/editcomment/8632 doesn’t open for me due to a permission problem.)
  • AirAir
    Posts: 10,970
    Tupamaros said: (The link http://support.apollo13.eu/vanilla/post/editcomment/8632 doesn’t open for me due to a permission problem.)
    Posted wrong link, sorry ;-)
    Good it works:-)

  • edited May 2014 Posts: 111
    Hi!
    These settings always get lost when I update the theme and have to be redone manually.

    Are thoses files (content.php, meta.php and utilities.php) affected by updates anway? Or can I just keep edited copies and overwrite after every update?

    Or is there a chance to comfortably keep these settings despite updating the theme?
    Thanks!
    Post edited by Tupamaros on
  • AirAir
    Posts: 10,970
    Tupamaros said: Are thoses files (content.php, meta.php and utilities.php) affected by updates anway?
    It depends what we are fixing/changing/adding.
    Tupamaros said: Or is there a chance to comfortably keep these settings despite updating the theme?
    Child theme http://apollo13.eu/docs/beach/#!/modification_of_theme_changing_theme_functions

    With regards.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion