Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #708308

    rajramayya
    Participant

    Hello,

    Another X Theme install. Maybe my 5th?

    I’m using a child theme and I want to enter css and scripts into the header but I cant find it.

    Help!

    πŸ˜‰

    A crazy combo of this stuff:

    <link rel=”stylesheet” type=”text/css” href=”https://www.radionomy.com/css/reset.css?v090115″>
    <link rel=”stylesheet” type=”text/css” href=”https://www.radionomy.com/css/style.css?v090115″>
    <link rel=”stylesheet” type=”text/css” href=”https://www.radionomy.com/css/responsive.css?v171214″>
    <link rel=”stylesheet” type=”text/css” href=”https://www.radionomy.com/css/jquery.mmenu.all.css?v171214″>
    <link rel=”stylesheet” type=”text/css” href=”https://www.radionomy.com/css/colorpicker.css?v171214″>
    <link rel=”stylesheet” type=”text/css” href=”https://www.radionomy.com/css/slick.css?v171214″>
    <link rel=”stylesheet” type=”text/css” href=”https://www.radionomy.com/css/modif.css?v290515″>
    <link rel=’stylesheet’ type=’text/css’ href=’//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700′>
    <style>
    .homeBackground { background: url(https://www.radionomy.com/images/home/justin.jpg) center center; -webkit-background-size: cover; -moz-background-size: cover; background-size: cover; height: 100%; }
    </style>

    <script type=”text/javascript” src=”https://www.radionomy.com/js/jquery.min.js?v171214″></script>
    <script type=”text/javascript” src=”https://www.radionomy.com/js/jquery.jplayer.min.js?v171214″></script>
    <script type=”text/javascript” src=”https://www.radionomy.com/js/jquery.mmenu.min.all.js?v171214″></script>
    <script type=”text/javascript” src=”https://www.radionomy.com/js/jquery.cookie.js”></script>
    <script type=”text/javascript” src=”https://www.radionomy.com/js/radionomy.player.js?v191214″></script>
    <script type=”text/javascript” src=”https://www.radionomy.com/js/common.js?v300915″></script>
    <script type=”text/javascript” src=”https://www.radionomy.com/js/player.js?v191214″></script>
    <script type=”text/javascript” src=”https://www.radionomy.com/js/website.js?v03042015″></script>
    <script type=”text/javascript” src=”https://www.radionomy.com/js/colorpicker.js?v171214″></script>
    <script type=”text/javascript” src=”https://www.radionomy.com/js/slick.min.js?v171214″></script>
    <script type=”text/javascript” src=”https://www.radionomy.com/js/blur.min.js?v171214″></script>
    <script type=”text/javascript”>
    $(function () {
    AddToHistory(‘/en/radio/animeradioexperience/share’);
    });
    </script>

    #708496

    Rupok
    Member

    Hi there,

    Thanks for writing in! Add the scripts with following format in functions.php of child theme

    function theme_name_scripts() {
      wp_enqueue_script('myscript', 'https://www.url/of/file/script.js'__FILE__);
      wp_enqueue_style('mystyle', 'https://www.url/of/file/style.css'__FILE__);
    }
    
    add_action( 'wp_enqueue_scripts', 'theme_name_scripts' );

    You need to replace https://www.url/of/file/script.js with URL of your JavaScript and https://www.url/of/file/style.css with URL of your CSS file. Add more files in same way.

    Hope this helps.

    Thanks

    #709428

    rajramayya
    Participant

    Thanks! I did it and I get this error message:

    Parse error: syntax error, unexpected ‘__FILE__’ (T_FILE) in /home/content/p3pnexwpnas05_data02/32/2949032/html/wp-content/themes/x-child/functions.php on line 25

    #709457

    rajramayya
    Participant

    thank you

    #709481

    Thai
    Moderator

    Hi There,

    Please update the previous code a bit:

    function theme_name_scripts() {
    	//add the Javascript file
    	wp_enqueue_script('myscript', 'https://www.url/of/file/script.js');
    	//add the CSS file
    	wp_enqueue_style('mystyle', 'https://www.url/of/file/style.css');
    }
    add_action( 'wp_enqueue_scripts', 'theme_name_scripts' );

    Let us know how it goes!

    #753891

    rajramayya
    Participant

    This worked out great btw. Thank you.

    #753905

    John Ezra
    Member

    You’re most welcome! πŸ™‚