Adding its title to the blog page


#1

Hi there,
I read with interest all your topics about the Title to Blog page.

could you help to make it look better please ?
Because I am using 2 languages, I do not want to write “blog” in here:

Blog

and I wish I could use the name given in the page (I am using a widget by SiteOrigin, but this one is hidden).

So I would be very grateful if you could tell me what to write, I mean, how to use the SiteOrigin widget title.

thanks !


#2

Hello there,

Try this solution: How to add heading on blog page?

Regards,
Kharis


#3

Hi Kharis,
thanks for your answer.
It’s working.
However I would like to add the name I gave to each blog page, as the one in French is different that the English one.
What can we write instead of ‘Blog’, please?


#4

Hello there,

Try this jQuery code:

    jQuery(function($) {

      if( $('body').hasClass('blog') ) {

        var lang    = $('html').attr('lang');
        
        var title   = 'Blog';

        if( lang == 'fr-FR' ) {
          title = "Blog page title for French";
        }

        if( lang == 'it-IT' ) {
          title = 'Blog page title for Italian';
        }
        
        var heading = '<div class="panel-grid-cell"><h3 class="widget-title">'+title+'</h3></div>';

        $('.post-wrap').prepend(heading);
        
      }
      
    }); 

The title for specific target language blog page is defined in this code block:

    if( lang == 'fr-FR' ) {
      title = "Blog page title for French";
    }

fr-FR value is taken from the the value of language attribute of HTML tag. You can find it with the web browser’s inspector tool. https://www.lifewire.com/get-inspect-element-tool-for-browser-756549

28%20AM


#5

This is perfect :slight_smile:
Thanks a lot Kharis.


#6

You’re welcome!

Please let us know in a new topic if you have any further questions, or if we can provide you with any other assistance.

Regards,
Kharis