Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thanks for this post it was very helpful. I needed my parent theme style to be loaded between the enqueued boostrap style and the child theme style. The Parent theme overrides some bootstrap styles and the child overrides some parent style. Believing that enqueued style is the best practices, I registered the bootstrap style in the parent theme. Then the child theme uses the add_action method you showed in the child theme function with the priority argument set to 11. Then in the parent theme I use add_action to enqueue the theme style(which pulls in the child style).

    examples:
    parent theme functions.php

    function register_scripts(){
    	...
    	wp_enqueue_style( 'bootstrap-css', get_template_directory_uri() . '/css/bootstrap/bootstrap.min.css' );
    	wp_enqueue_style( 'bootstrap-theme-css', get_template_directory_uri() . '/css/bootstrap/bootstrap-theme.min.css' );
    	....
    }
    
    add_action( 'wp_enqueue_scripts', 'register_scripts' );
    
    function register_childcss() {
    	wp_enqueue_style( 'style-css', get_stylesheet_uri() );
    }
    add_action('wp_enqueue_scripts', 'register_childcss', 15);

    child theme functions.php

    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', 11 );
    function theme_enqueue_styles() {
    	wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    }

    Please let me know if this is crazy, as I’m new to this.

    It would be sweet to be able to do this. I would like to display alternate size images on the front-end. So that the administrator doesn’t have to upload the correct size image but use WP to re-size.

    Hi I just updated and now “do not have sufficient permissions to access this page.” What capability is required? I deactivated and activated with no effect. I uninstalled and added through WP with no change.I am admin and can add plugins and edit users.

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