S
S
Sergey Yavin2020-08-21 13:03:49
WordPress
Sergey Yavin, 2020-08-21 13:03:49

How to make the links in the menu of the site on Wordpress work?

I'm creating a theme on Wordpress and ran into a problem due to inexperience. In HTML, the li > a tags indicate the path to the html file, but this does not work with wp. How to make wordpress navigate to other pages?

And another css question. Style.css contains the path to the image, how do I tell wp to see it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dima, 2020-08-21
@sjaserds

the picture is so

<img src="<?php echo esc_url( get_template_directory_uri() ); ?>/img/screenshot.png">

for the menu, use the built-in thing called the menu https://www.youtube.com/watch?v=Hls63xQLFY0
I advise you to look at something like this course. many questions will disappear immediately
https://www.youtube.com/watch?v=tvGfno8VLnw&list=P...

H
hypero, 2020-08-21
@hypero

Register the menu via the wp function - register_nav_menu(). You can look at wp-kama.ru for more details.
Picture - if the picture is in the theme folder, then leave it the same way, if in the upload folder, then change the path to it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question