L
L
ligisayan2017-08-04 12:14:40
PHP
ligisayan, 2017-08-04 12:14:40

How to get the site name in the original language on the error page?

Hello! You need to translate the phrase on the error page so that the link in it leads to the main page of the site.

<p>
    <?php
    printf(
    /* translators: %s: a link to the embedded site */
    __( 'It looks like nothing was found at this location. Maybe try visiting %s directly?' ),
'<strong><a href="' . esc_url( home_url() ) . '">' . esc_html( get_bloginfo( 'name' ) ) . '</a></strong>');?></p>

However, the link code is displayed after the paragraph.
<p>По данному адресу ничего не найдено. Попробуйте перейти на сайт <a href="#"></a>.</p>

As a result of testing, I found out that the bloginfo( 'name' ) and get_bloginfo( 'name' )
functions do not work on the error page. This entry displays an empty paragraph
$name = bloginfo( 'name' );
  echo '<p>'.$name.'</p>';

Although, for example, such a function works out and displays a link
$url = esc_html( get_bloginfo( 'template_url' ) );
       echo '<p>'.$url.'</p>';

Whether it is possible to bypass this moment somehow?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Lysenko, 2017-08-04
@LysenkoSasha

How exactly? Screenshot possible?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question