Try something like:
remove_action('init', 'sf_theme_js');
add_action('init', 'my_sf_theme_js');
function my_sf_theme_j() {
[ your fancybox calls go here ]
}
in the child theme’s functions.php file.
hi thanks for your help!
well, my apologies as i am not a programmer and i just sort of piece things together…
here’s what i ended up placing in my functions.php file:
<?php
remove_action(‘init’, ‘sf_theme_js’);
add_action(‘init’, ‘my_sf_theme_js’);
function my_sf_theme_js() {
wp_register_script(‘fancybox’, get_bloginfo(‘stylesheet_directory’) . ‘/scripts/fancybox/jquery.fancybox.js’, ‘jquery’);
wp_enqueue_style(‘fancybox’, get_bloginfo(‘stylesheet_directory’) . ‘/scripts/fancybox/style.css’););
}
?>
and i got this error:
Parse error: syntax error, unexpected ‘)’ in /home/kakaduna/public_html/wp-content/themes/kakadu-native/functions.php on line 6
then i tried this too and it doesn’t work either:
<?php
remove_action(‘init’, ‘sf_theme_js’);
add_action(‘init’, ‘my_sf_theme_js’);
function my_sf_theme_js() {
wp_register_script(‘fancybox’, get_bloginfo(‘stylesheet_directory’) . ‘/scripts/fancybox/jquery.fancybox.js’, ‘jquery’);
wp_enqueue_script(‘fancybox’);
}
?>
i don’t get an error message (well i do on some pages, but not others), but it changes my background image and the fancy box doesn’t work at all.
as for your error message, you have an extra );
here:
wp_enqueue_style('fancybox', get_bloginfo('stylesheet_directory') . '/scripts/fancybox/style.css'););
i’m not sure what you mean when you say what is on line 6?
Line 6 of functions.php. Try:
<?php
remove_action('init', 'sf_theme_js');
add_action('init', 'my_sf_theme_js');
function my_sf_theme_js() {
wp_register_script('fancybox', get_bloginfo('stylesheet_directory') . '/scripts/fancybox/jquery.fancybox.js', 'jquery');
wp_enqueue_style('fancybox', get_bloginfo('stylesheet_directory') . '/scripts/fancybox/style.css');
}
?>
thanks for your reply!
i deleted the extra ); and the same thing is happening with that code as with the code below it. it changes my background to the default parent theme background and then i get this error on one of the pages:
Warning: Cannot modify header information – headers already sent by (output started at /home/kakaduna/public_html/wp-content/themes/kakadu-native/functions.php:10) in /home/kakaduna/public_html/wp-includes/pluggable.php on line 890
and the fancy box feature does not work at all when i click on t thumbnail photo.
i copied and pasted your code, which looks the same as removing the extra ); and i am having that same issue with the background and this error message:
Warning: Cannot modify header information – headers already sent by (output started at /home/kakaduna/public_html/wp-content/themes/kakadu-native/functions.php:10) in /home/kakaduna/public_html/wp-includes/pluggable.php on line 890
and the fancy box feature does not work at all when i click on the thumbnail photo.
does it have something to do with the stylesheet that is being called in? why would it revert to the default parent theme background?
do you think this would also solve the problem with the background defaulting and the fancybox feature not working? because that error is only showing up on one page. but the other problems are on all pages.
It will remove the header warning – which would be a start.
thank you so much for your help!!! i deleted one blank line from my functions.php code so it looks like this:
<?php
remove_action(‘init’, ‘sf_theme_js’);
add_action(‘init’, ‘my_sf_theme_js’);
function my_sf_theme_js() {
wp_register_script(‘fancybox’, get_bloginfo(‘stylesheet_directory’) . ‘/scripts/fancybox/jquery.fancybox.js’, ‘jquery’);
wp_enqueue_style(‘fancybox’, get_bloginfo(‘stylesheet_directory’) . ‘/scripts/fancybox/style.css’);
}
?>
<?php
// Sidebar Widgets
register_sidebar(array(‘name’=>’Contact Page’,
‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3>’,
‘after_title’ => ‘</h3>’,
));
?>
and now it’s all working!