WordPress.org

Ready to get started?Download WordPress

Forums

Shadowbox JS
Not loading custom css file (4 posts)

  1. hafman
    Member
    Posted 2 years ago #

    Hello,
    Using Shadowbox JS version 3.0.3.8
    I'm trying to load a custom css file from my theme as documented on the plugin page. I've followed the procedure to the letter (except - read below!) yet shadowbox.css is stubbornly loading from the plugin directory.

    Also the instructions mention a 'functions.js' file, does that exist in any WordPress theme? I used functions.php anyway.

    http://wordpress.org/extend/plugins/shadowbox-js/

  2. duepi.biz
    Member
    Posted 2 years ago #

    Same here...
    Have you found any other solution than editing the plugin files ?
    Tanks in advance
    P.

  3. Matt Martz
    Member
    Plugin Author

    Posted 2 years ago #

    Try placing the code in a new plugin, or a mu-plugin.

    if you create a directory at /wp-content/mu-plugins and create a php file of any name in there and paste in the following code:

    <?php
    function custom_shadowbox_css($url) {
        return get_bloginfo('stylesheet_directory') . '/css/shadowbox.css';
    }
    add_filter('shadowbox-css', 'custom_shadowbox_css');
    ?>

    You will be good to go.

  4. duepi.biz
    Member
    Posted 2 years ago #

    Hy Matt and thanks for your quick response!

    What i'm trying to do is to add

    function custom_shadowbox_css($url) {
        return get_bloginfo('stylesheet_directory') . '/css/shadowbox.css';
    }
    add_filter('shadowbox-css', 'custom_shadowbox_css');

    in functions.php of my child theme only if the plugin is present and active.

    Well, i think there is some synchronization issue between inc/frontend.php apply_filters call and add_filter in functions.php; do you think it's possible ?
    Can you give me any tips ?

    Once again, thank's in advance
    P.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic