WordPress.org

Ready to get started?Download WordPress

Forums

Genesis Responsive Slider
[resolved] CSS displayed in page, can we move this to another CSS file? (9 posts)

  1. titush
    Member
    Posted 1 year ago #

    Hi everyone,

    I have a question regarding the CSS that is rendered by the responsive slider. I don't want any CSS code in my source code, as I would prefer to have the entire site CSS in a single file. So far I have succeeded, however the responsive slider still outputs CSS in the source code of the homepage:

    <style type="text/css">
    			.slide-excerpt { width: 50%; }
    			.slide-excerpt { bottom: 0; }
    			.slide-excerpt { right: 0; }
    			.flexslider { max-width: 520px; max-height: 305px; }
    			.slide-image { max-height: 305px; }
    		</style>
    		<style type="text/css">
    			@media only screen
    			and (min-device-width : 320px)
    			and (max-device-width : 480px) {
    				.slide-excerpt { display: none !important; }
    			}
    </style>

    Is there anything I can do to prevent this, possibly without modifying any core plugin files?

    Thanks, Titus

    http://wordpress.org/extend/plugins/genesis-responsive-slider/

  2. ha_ulrich
    Member
    Posted 1 year ago #

    You can copy the code there and put it in your, or in a separate CSS file, at least when you make use of a Child Theme.

    Then, it's in there twice.

    To get it out of the plugin, you'll have to edit the plugin files. Find it and take or comment it out.

    Of course that is not the best way. When your plugin is updated by the author, your customizations get overwritten. Can you get in contact with the author and ask him to add it in a CSS-file in his plugin, instead of dumping it in your code? That would be the best, also for other users.

  3. titush
    Member
    Posted 1 year ago #

    Hi and thanks for your quick reply. Yes, I figured what you outlined above, and, as you say, I'd prefer the CSS to be in a separate file, so that I can minify it...

    I'll try and get in touch with them over at studiopress..

  4. titush
    Member
    Posted 1 year ago #

    Actually, I just checked over at studiopress and they are referring to this page for support so I hope a programmer over there sees this post.

    Thanks, Titus

  5. dreamwhisper
    Member
    Posted 1 year ago #

    This should work in your functions.php file:

    add_action( 'after_setup_theme', 'custom_slider_init', 16 );
    /**
     * Make amendments to the Genesis Slider, after it has been fully initialised.
     *
     * @since 1.0.0
     */
    function custom_slider_init() {
    	remove_action( 'wp_head', 'genesis_responsive_slider_head', 1 );
    }
  6. dreamwhisper
    Member
    Posted 1 year ago #

    Note that removes what is added to the head. It doesn't create a separate CSS file, obviously. You'll have to add whatever CSS you need to another file.

  7. titush
    Member
    Posted 1 year ago #

    Hi, thanks for that, it solved the problem. Any chance that this could be included in future versions of the script, given the everlasting dedication of studiopress to be the most SEO compliant theme framework?

    Thanks ;-)

  8. dreamwhisper
    Member
    Posted 1 year ago #

    You're welcome. I can't really speak to an external css file being included in a future version, but just remember that if you want to make changes to some of the slider settings, you'll need to do it in the css now rather than the settings :)

  9. titush
    Member
    Posted 1 year ago #

    Yeah, that's o.k. I appreciate your support. I really dislike when scripts or plugins clutter my index.php with css ;-)

    And so does Google ;-)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic