S
S
Snatch082021-09-22 20:23:15
WordPress
Snatch08, 2021-09-22 20:23:15

How to insert into div by id via PHP via function.php WordPress?

How to insert new content into div with id="Start" via function.php? In WordPress?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Zolin, 2021-09-23
@artzolin

You have two options:
1. create a child theme, copy the header.php file from the parent theme and paste the one you need in the place you need <div>
2. create a child theme, find the hook in the parent theme, in the place where you need it <div>and hang it on this hook function

add_action( 'wp_body_open', 'start_div' );
function start_div() {

  echo '<div id="start" class="start">';

}

Keep in mind that you need to hang somewhere and closing </div>, otherwise your whole layout will go

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question