Include HTML (Bootstrap Modal Box) with a plugin into my header

You only need the_content filter to add the modal, but bootstrap.js is needed to make it work. add_action(‘wp_enqueue_scripts’, array($this, ‘enqueue_bootstrap’); public function enqueue_bootstrap(){ wp_register_script( ‘bootstrap’, plugins_url( ‘your-plugin/assets/js/bootstrap.min.js’ ) ); wp_enqueue_script( ‘bootstrap’ ); } EDIT: You need to add $content argument to your function. As the codex says Note that the filter function must return the … Read more

Wrong image path within inline styles in the head

If they are inline, your image paths should be /wp-content/themes/theme_name/ and then whatever the directory is in. Since you are already loading them via file_get_contents(), why not do a search & replace and use the full URL for them? With proper caching, this shouldn’t make any impact on the load time itself. The usual way … Read more

Run shortcode in custom script in wp_head if post type is CPT ‘Jobs’

You shouldn’t do it in a shortcode, you should enqueue this particular JavaScript file only for the page you want. Place something like this in your functions.php: function my_custom_scripts() { if( is_singular(‘job’) ){ wp_enqueue_script(‘jobpostingschema’, get_stylesheet_directory_uri() . ‘/js/jobpostingschema.js’, array(), ”, false); } } add_action(‘wp_enqueue_scripts’, ‘my_custom_scripts’);

How can I pass a shortcode value to the head in wordpress functions.php

Shortcodes, as I understand them, are to be used inside content of pages/posts, and (with 4.9) widgets. They aren’t supported inside other spots on the page, only in the page/post/widget content. From the Codex: https://codex.wordpress.org/Shortcode [WP] only expands the shortcodes within the content of a Post, Page, or custom post type. But I don’t think … Read more

Remove CSS & JS from

Sounds like some filter is placing the create.css file there. Check your functions.php (or search for the following function inside the theme with your text editor in case some other file is enqueueing those assets) for wp_enqueue_style and see if you have that file enqueued. Other way of doing this is using the filter wp_head, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)