Why does the trailing slash appear after url when using home_url() in WordPress?

Example: when the home_url() function is used to fill the value for the href attr in a tag, for example the name of the site:

<h1><a href="<?php echo home_url(); ?>">
        <?php bloginfo('name'); ?></a>
</h1>

With no $path parameter added to the function (‘/’) how does the trailing slash end up in the url after the link is clicked?

Read More

In the database, in the “home” record(wp_options table) there is no trailing slash at the end of the url: http://localhost/wordpress.
So, what’s going on?

Related posts

1 comment

Comments are closed.