• Resolved Antscran

    (@antscran)


    Hi All,

    I have a child theme running on Twenty Twelve, and thought my theme would withstand any updates due to this as have all the modified files in the correct structure.

    I have recently carried out the 3.6 update and didn’t notice any issues, and now carried out the Twenty Twelve update. I now have an issue with a lightbox variant called Fancybox.

    The issue is the image instead of popping out and centering on the screen, it appears at the top of the page full size, and cannot be cleared except by navigating away.

    This is a code extract from the functions.php file in my child theme concerned with the Fancybox.

    /* SCRIPTS AND STYLES FOR FANCYBOX ---------------------------------------- Add acripts and styles for Fancybox */
    function twentytwelve_add_lightbox() {
        wp_enqueue_script( 'fancybox', get_template_directory_uri() . '/inc/lightbox/js/jquery.fancybox.pack.js', array( 'jquery' ), false, true );
        wp_enqueue_script( 'lightbox', get_template_directory_uri() . '/inc/lightbox/js/lightbox.js', array( 'fancybox' ), false, true );
        wp_enqueue_style( 'lightbox-style', get_template_directory_uri() . '/inc/lightbox/css/jquery.fancybox.css' );
    }
    add_action( 'wp_enqueue_scripts', 'twentytwelve_add_lightbox' );

    A sample of the problem can be viewed here;

    https://coder-tronics.com/state-machine-tutorial-pt1/

    The original tutorial I followed is here;

    https://wp.tutsplus.com/tutorials/theme-development/add-a-responsive-lightbox-to-your-wordpress-theme/

    Cheers,

    Ant

Viewing 4 replies - 1 through 4 (of 4 total)
  • This get_template_directory_uri() instead of get_stylesheet_directory_uri() used in your child function indicates that you had put the lightbox JS and CSS in parent theme folder. When updated, they are gone.

    Thread Starter Antscran

    (@antscran)

    Paul thanks,

    Arh ok, damn see now!

    I remember doing this now planning to migrate them to the child theme folder but never worked how to do it.

    Any chance you could tell me what the code line would be so I can place them in the child theme folder?

    Regards,

    Ant

    Thread Starter Antscran

    (@antscran)

    Paul,

    Thanks and realised now substituted get_template_directory_uri() for get_stylesheet_directory_uri() and created a folder called ‘inc’ in the child theme with my java script files.

    Edit: Just saw your above post. So it’s all good.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Recent Update Twenty Twelve’ is closed to new replies.