WordPress Site Title and Tagline

WordPress Site Title is the Title given to the website.

The tagline is something like a slogan, subtitle which tells the visitor what is on the website or article. It simply gives a better idea of what the visitor will see on that.

So be careful while giving a tagline as it reflects the SEO too.

Here’s how to echo or print a title or tagline in the template using PHP:

For the website name:

<?php echo get_bloginfo('name'); ?>

For the tagline:

<?php echo get_bloginfo('description'); ?>

Translate month name in WordPress

In WordPress, you might want to rename posts’ month name from English to Dhivehi or whatever language. This is a very simple function which will help you change the posts’ month name.

Put this into your function.php

function mas($month) {
switch ($month) {
case 1:
    $mas = "ޖަނަވަރީ";
    break;
case 2:
    $mas = "ފެބުރުވަރީ";
    break;
case 3:
    $mas = "މާރިޗު";
    break;
case 4:
    $mas = "އެޕްރީލް";
    break;
case 5:
    $mas = "މެއި";
    break;
case 6:
    $mas = "ޖޫން";
    break;
case 7:
    $mas = "ޖުލައި";
    break;
case 8:
    $mas = "އޯގަސްޓު";
    break;
case 9:
    $mas = "ސެޕްޓެންބަރު";
    break;
case 10:
    $mas = "އޮކްޓޯބަރު";
    break;
case 11:
    $mas = "ނޮވެންބަރު";
    break;
case 12:
    $mas = "ޑިސެންބަރު";
    break;
}
return($mas); }

 

And use this wherever you want to view the date in Dhivehi.

<?php echo mas(get_the_date('n')); ?>