500 server error after enqueuing style in plugin
-
Hi
I am trying to equeue a style in my plugin, but it produces a Server Error with code 500. I’ve been testing the code and as soon as I comment out add_action line, the site goes back to normal.
I tested the code by pasting it into functions.php file of the the child theme and it worked there, but as soon as I move it to the plugin, the site crashes.
Here is the code:
add_action( 'wp_enqueue_scripts', 'enqueue_plugin_styles' ); function enqueue_plugin_styles() { wp_enqueue_style( 'main-search-header', get_bloginfo('url') .'/wp-content/plugins/uppskriftabok-custom/css/main-search-header.css' ); }
I tried to get the url by an absolute path (https://etc etc), through bloginfo() and of course plugins_url(). None works in the plugin (does through the theme though), the problem doesnt seem to be there.
Some info on the plugin:
It is just a plugin where I add any extra functionality to the theme later on. I am just starting out with it, I only have shortcode defined in it that inserts an html block into the page. It all works, I am trying to add the stylesheet that contains the formatting for the html block that is inserted…Anyone with any idea? I have even increased the wp memory limit…
Would be greatful for some ideas.
- The topic ‘500 server error after enqueuing style in plugin’ is closed to new replies.