user3571889 user3571889 - 1 month ago 16
PHP Question

How to go one step back in WordPress

I have been trying to add a file that is NOT present in current directory using '..'(Double Dotts).

But it shows complete_url/../scripts/style.cssstyle.css?ver=4.6.1' ..

$wp_easy_seo_scripts =plugin_dir_path(__FILE__).'../scripts/style.css';


why it is showing double dot .. in output too ? How to fix it ?

Answer

Why not...

$wp_easy_seo_scripts ='/path-to_directory/scripts/style.css';

Keep in mind, the path-to-directory will be from your www/public_html directory (document root), so you should not need those directories in the path.. but just in case, if you do, it might look something like this

$wp_easy_seo_scripts ='/home/user/www/path-to_directory/scripts/style.css';