I’m trying to us get_option
in my plugin to choose to load 1 of 3 js files.
I started with this (and it works) …
add_action('wp_footer','isotope_vpl_set_style');
function isotope_vpl_set_style() {
include("inc/myfile.js");
}
then I changed it to …
add_action('wp_footer','isotope_vpl_set_style');
function isotope_vpl_set_style() {
$style = (get_option('damien_style');
if $style = ("isotope"){
include("inc/myfile.js");
}
}
And it’s not working … I checked the SQL table and the option name and value are set.
My PHP error log tells me I have an unexpected ; on this line $style = (get_option('damien_style');
Where have I gone wrong please 🙂
You had an extra
(
beforeget_option
and the if statement syntax was wrong. Here is the revised code: