Because these files are not integrated to the wordpress theme

0

Good day, I ask this question since I am trying to integrate a file with css properties to WORDPRESS where I have everything related to the responsive and the topic is not applying the changes the same thing happens with the .js file that I want to add , what seems more strange to me is that the template is taking the styles css from the style.css file but the ones from the responsive.css do not take them

for the sagregar styles css use these tags

<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url') ?>">

for the responsive.css file use this function

<link rel="stylesheet" href="<?php bloginfo('template_url');?>/responsive.css">
    
asked by Juan David 02.12.2017 в 18:44
source

1 answer

2

Currently wordpress recommends using the following method to add both css and js files to the topics and not placing them in the header.php. You must add the following function in the functions.php (change the "xxx" by the name of your theme):

function xxx_scripts() {

  wp_enqueue_style( 'style', get_stylesheet_uri() );

  //cambia el "main" por el nombre del archivo css y la ruta por la tuya
  wp_enqueue_style( 'main', get_theme_file_uri('css/main.css') );

  //para agregar los scripts se emplea lo siguiente de la misma forma que el anteior:
  wp_enqueue_script ('main', get_theme_file_uri('js/main.js') );
}

add_action( 'wp_enqueue_scripts', 'xxx_scripts' );
    
answered by 07.02.2018 в 19:03