I have a page which contains a link tags for stylesheets and scripts for the javascript files, I want to append those scripts in the head section of the page but using the php not using jQuery.
Testimonial.php
$ex_style = '<link href="'.$_path_.' /css/style.css" rel="stylesheet" type="text/css" />';
$ex_script = '<script src="'.$_path_.' /js/scripts.js" type="text/javascript" />';
// My PHP Code
...
How do I use above $ex_style
and $ex_script
using php and append in head of the page?
Lets take it this way.
I have a testimonials script which is installed on a www.domain-a.com, I want to display testimonials in sidebar on www.domain-b.com using php function like
include('http://www.domain-a.com/script/testimonial.php');
Where testimonial.php
contains only php code and javascript and css it does not have <head>
and <body>
elements.
Example : in Wordpress there is a parameter in wp_enqueue_script function where we can set it to add script in footer.