How to include bootstrap in Wordpress plugin development?

前端 未结 3 1019
野性不改
野性不改 2021-02-13 15:42

I am developing the plugin, and I would like to include bootstrap in my plugin. What is the best way to include? I couldn\'t find anything related to this, so far I have found s

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-13 15:50

    You can use the 'wp_head' action to add code to the header of the site each time the page loads. Put something like this into your plugin:

        add_action('wp_head','head_code');
    
    function head_code()
    {
    
    $output = '';    
    $output .= ''; 
    $output .= '';
    
    echo $output;
    
    }
    

提交回复
热议问题