-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathfunctions.php
75 lines (57 loc) · 2.34 KB
/
functions.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
function init_template(){
add_theme_support( 'post-thumbnails');
add_theme_support( 'title-tag' );
register_nav_menus(
array(
'top_menu' => 'Principal'
)
);
}
add_action('after_setup_theme','init_template');
function template_styles(){
wp_register_style('bootstrap','https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css',false,'4.4.1','all');
wp_register_style('montserrat','https://fonts.googleapis.com/css?family=Montserrat&display=swap',false,'','all');
wp_enqueue_style('main-style', get_stylesheet_uri(), array('bootstrap','montserrat'),'1.0','all');
wp_register_script( 'popper', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js', false, true );
wp_enqueue_script( 'bootstrap', 'https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js', array('jquery','popper'), true);
wp_enqueue_script( 'custom', get_template_directory_uri()."/assets/js/custom.js", false,"1.1", true );
}
add_action('wp_enqueue_scripts','template_styles');
function registrar_sidebar(){
register_sidebar( array(
'name' => 'Pie de página',
'id' => 'footer',
'description' => 'Zona de Widgets para pie de página',
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<p>',
'after_title' => '</p>',
));
}
add_action('widgets_init','registrar_sidebar');
function productos_type() {
$labels = array(
'name' => 'Productos',
'singular_name' => 'Producto',
'menu_name' => 'Producto',
);
$args = array(
'label' => 'Productos',
'description' => __( 'Facturas emitidas por suscripción', 'lst' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'thumbnail', 'revisions'),
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-cart',
'show_in_nav_menus' => false,
'show_in_rest' => true,
'can_export' => true,
'publicly_queryable' => true,
'rewrite' => true,
);
register_post_type( 'producto', $args );
}
add_action( 'init', 'productos_type');