• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Can I override any plugin's css using my child theme

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Can I override any plugin's css using my child theme

This topic is: not resolved

Tagged: css, Metro Pro, seo, yoast

  • This topic has 5 replies, 2 voices, and was last updated 8 years ago by westerdaled.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • March 19, 2015 at 2:24 pm #144962
    westerdaled
    Member

    Hi

    I doing a bit of house keeping on my Metro Pro blog and noticed there is still an issue with the Yoast Plugin which requires some classes in metabox-tabs.css following classes to have the display property overridden ( or removed entirely in FireBug)

    ul.wpseo-metabox-tabs {
    	display: none;
    	margin-top: 12px;
    	margin-bottom: 3px;
    }
     
    .wpseotab {
    	display: none;
    }
    

    Anybody suggest how I could override these in the child theme or some other technique applicable to Genesis?

    Daniel

    March 19, 2015 at 7:17 pm #144978
    Brad Dalton
    Participant

    Try !important Example http://www.w3.org/TR/CSS2/cascade.html#value-def-inherit

    Or

    You can dequeue your plugins style sheet from your child theme and load it in your child theme.


    Tutorials for StudioPress Themes.

    March 20, 2015 at 8:33 am #145021
    westerdaled
    Member

    Brad

    Thanks for your reply .

    1) I have tried

    display: block !important;
    

    to both of the above classes and this had no effect. Incidentally, to test moved from FireFox->Firebug to Chrome-Web Developer tools plugin and this is taking a bit of getting used to to see what .css is loads. I use for Chrome in all my VMs

    I have looked at the functiions.php and I need to add an action to dequeue metabox-tabs.min.css and paste these classes into styles.css .. This strikes me as a maintenance headache after updates to my theme or changing the them altogether . Unless there is normal practice for WordPress devs or there isn't a a ultra simpler way of sorting this, such as adding override.css as the last Css to be added.

    One thought depending on your answer is if Genesis SEO is good as people indicate it is, then why am I bothering with Yoast and wresting with this issue?

    March 20, 2015 at 8:40 am #145026
    Brad Dalton
    Participant

    The dequeue function doesn't seem to work very well based on my experiences using it. Just make sure you use the same handle used for enqueueing it in the plugin.

    There's no updates to child themes.

    Different people have different opinions on SEO.

    I think Yoast has some good features but i don't see any proof any SEO plugin makes any difference.

    I did notice in some cases the SEO settings page for Genesis SEO disappear after deactivating Yoast where they're supposed to come back.


    Tutorials for StudioPress Themes.

    March 21, 2015 at 2:24 pm #145111
    westerdaled
    Member

    Brad

    Ok , with your guidance and a bit of Googling I quickly built a plugin in NotePad++ to do as you suggested

    
    function wsl_css_fixes_added_to_head() {
     
        //wp_enqueue_script('jquery');
     
       
        /* the code class-metabox.php:  wp_enqueue_style( 'metabox-tabs', plugins_url( 'css/metabox-tabs' . WPSEO_CSSJS_SUFFIX . '.css', WPSEO_FILE ), array(), WPSEO_VERSION ); */
        /* remove the above class library that is supplied by Yoast */
        wp_dequeue_style( 'metabox-tabs' );
    	
    	
    	$fixstyle = WSLCSSFIXES_PLUGIN_URL . '/css/metabox-tabs-fixed.css';
    	$handle = 'metabox-tabs-fixed' ;
    	wp_register_style( $handle, $fixstyle,'','', 'screen' );
        wp_enqueue_style( $handle);
    }
    
     
     /* attach my custom hook function to this event */
    add_action( 'wp_enqueue_scripts', 'wsl_css_fixes_added_to_head' );
    /* Stop Adding Functions Below this Line */
    ?>
    

    I Ftped my plugin over to my blog site and activate my plugin. I can see my style sheet is there on my home page ( in Firebug lite) - I can even inspect my css file to see I have removed the display property in two of the classes. The thing is the Yoast options panel on the page edit screen is where I should be triggering my dequeue metabox tabs and enqueuing my fix css so I need to hook into that event....

    March 23, 2015 at 11:44 am #145346
    westerdaled
    Member

    Hi any update on this please. Is it easy to inject styles or scripts in this location?

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble