Answer the question
In order to leave comments, you need to log in
Change data on entire Wordpress site?
Hello. There is a need to change data on the entire CMS Wordpress site, in other words, how can such functionality be implemented.
For example: there is a company name LLC "Horns and Hooves", this name will be in the headings, in the text, in the footer, and on different pages. At some point, it is necessary to change, for example, the name to Proctel and Gamble LLC. How can this be done in one place and have the change happen throughout the site?
Answer the question
In order to leave comments, you need to log in
ACF
plugin .
Create an Options Page , hook an arbitrary field to it.
Next, display this custom field where necessary
. Changing the value in one place will change throughout the site. 'field_name', 'option');
the_field(
create a widget
This is how I made it possible to change the main photo in the landing page
But I think if you need to change a lot of information, then ACF is better
function name_widget_init() {
register_sidebar( array(
'name' => 'Фото',
'id' => 'photo',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '',
) );
}
add_action( 'widgets_init', 'name_widget_init' ); // Добавляем виджет в админку
<?php dynamic_sidebar( 'photo' ); ?> // Выводим виджет на сайте
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question