V
V
Vladimir Privalov2018-04-21 20:20:49
WordPress
Vladimir Privalov, 2018-04-21 20:20:49

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

2 answer(s)
A
Alexander, 2018-04-21
@apisklov

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. <?php the_field('field_name', 'option'); ?>

K
Konstantin Teploukhov, 2018-04-21
@blood-moon

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

The code
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 question

Ask a Question

731 491 924 answers to any question