Raphael Rafatpanah
Raphael Rafatpanah

Reputation: 19997

get_template_directory_uri() returning wrong URI after defining WP_HOME / WP_SITEURL

In functions.php, we are setting the WP_HOME and WP_SITEURL like so:

define('WP_HOME', ...);
define('WP_SITEURL', ...);

I can verify that the value of ... above is correct.

However, get_template_directory_uri() returns the wrong URI.

What needs to be changed to ensure that get_template_directory_uri() is using the correct URI based on the value of WP_HOME / WP_SITEURL?

Upvotes: 1

Views: 2523

Answers (1)

Punit Patel
Punit Patel

Reputation: 361

Can you please add following at wp-config.php

define('WP_HOME', ...);
define('WP_SITEURL', ...);

Upvotes: 7

Related Questions