Hi,
Here’s a quick background to give context to my question.
I recently moved my site to Kinsta, with the DNS pointed to Cloudfare and monetizing it with Ezoic.
Ezoic recently sent me a message that I needed to “Set up an X-Forwarded-For Header”.
One of the options listed here (https://support.ezoic.com/en/support/solutions/articles/48000453992-using-the-x-forwarded-for-xff-header) is to add this code in the wp_config file of the WordPress theme.
// Use X-Forwarded-For HTTP Header to Get Visitor's Real IP Address
if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
$http_x_headers = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );
$_SERVER['REMOTE_ADDR'] = $http_x_headers[0];
}
Which brings me to the question, how do I add a wp_config file on the child theme?
I asked Ezoic if I could add the code instead to the main wp_config file in the root directory, they told me to ask the theme developer “if the theme is linked to the main wp-config file”.
So it’s two questions.
1. Can I add a wp_config file within the child theme?
2. WOuld it be possible to add the code in the main wp_config file if the first option isn’t possible?