diff --git a/functions.php b/functions.php index a61ba10..a7f7b0f 100644 --- a/functions.php +++ b/functions.php @@ -18,6 +18,67 @@ 'primary' => __( 'Menu Principal', 'Dreams Consulting' ), ) ); + //----// + function add_dreamsconsulting_css_js() + { + // Registrar los estilos css + wp_register_style( 'bootstrap-min-css', get_stylesheet_directory_uri() . '/css/bootstrap.min.css', array(), ' + 3.3.4', 'all' ); + wp_register_style( 'fontawesome-min-css', get_stylesheet_directory_uri() . '/css/font-awesome.min.css', array(), ' + 4.7.0', 'all' ); + + $query_args_1 = array( + 'family' => 'Open+Sans|Roboto+Condensed:300|Signika' + ); + wp_register_style( + 'google-fonts-1', + add_query_arg( $query_args_1, '//fonts.googleapis.com/css' ), + array(), + null + ); + + wp_register_style( 'owl-carousel-css', get_stylesheet_directory_uri() . '/css/owl.carousel.css', array(), '2.2.1', 'all' ); + wp_register_style( 'owl-theme-css', get_stylesheet_directory_uri() . '/css/owl.theme.default.min.css', array(), '2.2.1', 'all' ); + wp_register_style( 'animate-css', get_stylesheet_directory_uri() . '/css/animate.css', array(), '3.5.2', 'all' ); + wp_register_style( 'style-css', get_stylesheet_directory_uri() . '/style.css', array(), '1.3.4', 'all' ); + + // Registrar los scripts js + wp_register_script( 'bootstrap-min-js', get_template_directory_uri().'/js/bootstrap.min.js', '', '', true ); + wp_register_script( 'owl-carousel-min', get_template_directory_uri().'/js/owl.carousel.min.js', '', '', true ); + wp_register_script( + 'googlemap', + 'https://maps.googleapis.com/maps/api/js?key=AIzaSyCKH_Kfp9e1DmJJMKQBiAtQ_oGhIU3QfFE', + array(), + null, + false + ); + wp_register_script( 'cargar-js', get_template_directory_uri().'/js/cargar.js', '', '', true ); + + // css + wp_enqueue_style('bootstrap-min-css'); + wp_enqueue_style('fontawesome-min-css'); + wp_enqueue_style('google-fonts-1'); + wp_enqueue_style('owl-carousel-css'); + wp_enqueue_style('owl-theme-css'); + wp_enqueue_style('animate-css'); + wp_enqueue_style('style-css'); + + // js + wp_enqueue_script('bootstrap-min-js'); + wp_enqueue_script('owl-carousel-min'); + wp_enqueue_script('googlemap'); + wp_enqueue_script('cargar-js'); + + } + add_action( 'wp_enqueue_scripts', 'add_dreamsconsulting_css_js' ); + + function add_scripts() { + wp_deregister_script('jquery'); + wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js', '', '1.12.4', false); + wp_enqueue_script( 'jquery' ); + } + add_action('wp_enqueue_scripts', 'add_scripts'); + // Soporte imagenes destacadas (featured images) add_theme_support( 'post-thumbnails' ); @@ -56,7 +117,25 @@ function header_widgets_init() ) ); } - add_action( 'widgets_init', 'header_widgets_init' ); + add_action( 'widgets_init', 'header_widgets_init' ); + + /*----------------------------------------------------- + * widget para el footer + *----------------------------------------------------*/ + + function footer_widget_init() + { + register_sidebar( array( + 'name' => __( 'Pie de pagina', 'Dreams Consulting' ), + 'id' => 'footer-1', + 'description' => __( 'Un área de widget para el pie de pagina', 'dreams consulting' ), + 'before_widget' => '
', + + ) ); + + } + add_action( 'widgets_init', 'footer_widget_init' ); // sidebar derecha function sidebarDerecha() @@ -145,9 +224,11 @@ function wp_pagination_search() } // Crear Shorcote Carousel - function jg_slider($atts) + function jg_slider($content = null) { + ob_start(); + $args_elecciones = array( 'post_type' => 'elecciones', 'post_status' => 'publish', @@ -156,47 +237,101 @@ function jg_slider($atts) 'order' => 'ASC' ); - $elecciones_data = new WP_Query($args_elecciones); + $elecciones_data = new WP_Query($args_elecciones); + + ?> + +'.$titulo.'
'; - $texto .= ''; - $texto .= '