functions.php
Создание собственного виджета
В этом коде некоторые вещи могут вызвать у вас вопросы. Скажем, к примеру, что делает wpb_text_domain. WordPress использует gettext для обработки трансляции и локализации. Так вот: wpb_text_domain и __e указывают gettext на то, что эти строки доступны для перевода.
Как создать ссылку «Read More» с помощью the_excerpt () на статической главной странице?
When you fill the Excerpt box with any text on post edit page, the_excerpt() function doesn’t add any read more or … at the end of the short description. Read more is only included if Excerpt is set empty, and this is not a bug, it’s a feature. Now the solution is to avoid the excerpt_more filter to return read more, and use the the_excerpt
Добавление класса к пунктам меню через functions.php
Добавим CSS класс, если это пост и название элемента меню равно «blog»:
Добавление класса к пунктам меню через functions.php Leggi tutto »