How to make custom page link to root automatically?

I've put / in my Home custom page link, and locally my server is localhost:3000 and it works fine, but on my server the url is www.mysite.com/theproject, but / there does not lead to www.mysite.com/theproject but to www.mysite.com, but for example the logo which has a link like so ?= esc_url(home_url('/')); ? works fine on the server.

Any way to make the custom page link behave like it has ?= esc_url(home_url('/')); ? ?

Topic home-url permalinks server Wordpress

Category Web


For the url to the root of the Wordpress installation you can use:

<?php echo site_url(); ?>

see: https://codex.wordpress.org/Function_Reference/site_url

Edit: please check your url settings in the general Wordpress settings.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.