Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • in reply to: client field in portfolio item #158306
    larsgrau
    Member
    Post count: 4

    +1 // that would be a great feature. Any updates yet?

    in reply to: Help needed with child theme #157778
    larsgrau
    Member
    Post count: 4

    Hi Rui, OMG you guys answer so quick. Great! // I tried your suggestion already, but that leads to duplicate styles.css files. I now ended up doing this in my child theme’s functions.php:

    The only downside is that I had to add a dependency to the bootstrap.css otherwise the styles.css files were printed BEFORE bootstrap’s css …

    Do you see any obstacles in doing so?

    Thanks!

    <?php
    
    // Enqueue the parent and child theme stylesheets 
    // See http://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme 
    
    // First, dequeue the parent stylesheet, otherwise it is duplicated
    // Dante uses the styles.css stylesheet as "sf-main-css", so unqueue it
    function theme_dequeue_styles() {
        wp_dequeue_style(array('sf-main', 'sf-main-css'));
        wp_deregister_style( array('sf-main', 'sf-main-css'));
    }
    
    // 99999 means really high priority
    add_action('wp_enqueue_scripts', 'theme_dequeue_styles', 99999);
    
    // Now enqueue the child theme's stylesheet depending on the parent's
    // Note that wp_register_style() is NOT needed if you use fully qualified wp_enqueue_style()
    	
    function theme_enqueue_styles() {
        wp_enqueue_style( 'dante-parent-style', 
        	get_template_directory_uri() . '/style.css', 
        	array('bootstrap')
        );
        wp_enqueue_style( 'mokik-child-style',
            get_stylesheet_directory_uri() . '/style.css',
            array('dante-parent-style')
        );
    }
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    	
    	
    ?>
    in reply to: Help needed with child theme #157746
    larsgrau
    Member
    Post count: 4

    Hi Mohammad, thanks for fast reply. My point is that @import(“parent.css”) is not best practice. What I am trying to achieve is what is outlined here: http://wordpress.stackexchange.com/questions/163301/versioning-import-of-parent-themes-style-css

Viewing 3 posts - 1 through 3 (of 3 total)