-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.php
More file actions
71 lines (71 loc) · 3.12 KB
/
functions.php
File metadata and controls
71 lines (71 loc) · 3.12 KB
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
<?php
add_filter( 'show_admin_bar', '__return_false' );
// register_sidebar(
// array(
// 'name' => __( 'coello-blog-sidebar', 'coello-trejo' ),
// 'id' => 'sidebar-coello',
// 'description' => __( 'Sidebar para Coello Trejo' ),
// 'before_widget' => '<li>',
// 'after_widget' => '</li>',
// 'before_title' => '<h3>',
// 'after_title' => '</h3>',
// ));
//
add_theme_support( 'custom-logo', array('header-text' => array('Coello Trejo', 'Abogados')) );
add_theme_support( 'menus' );
add_theme_support('post-thumbnails');
// Dependencias
add_action( 'wp_enqueue_scripts', 'dependencias' );
function dependencias() {
wp_enqueue_style( 'slick-css', get_template_directory_uri() . '/node_modules/slick-slider/slick/slick.css');
wp_enqueue_style( 'slick-theme', get_template_directory_uri() . '/node_modules/slick-slider/slick/slick-theme.css');
wp_enqueue_style( 'bootstrap-styles', get_template_directory_uri() . '/node_modules/bootstrap/dist/css/bootstrap.min.css');
wp_enqueue_style( 'app-styles', get_template_directory_uri() . '/assets/css/app.css');
wp_enqueue_style( 'wp-styles', get_template_directory_uri() . '/style.css');
//
wp_enqueue_script( 'bootstrap-scripts', get_template_directory_uri() . '/node_modules/bootstrap/dist/js/bootstrap.js', array('jquery'));
wp_enqueue_script( 'slider-script', get_template_directory_uri() .'/node_modules/slick-slider/slick/slick.min.js', array('jquery') );
wp_enqueue_script( 'app-js', get_template_directory_uri() . '/assets/js/app.prod.js', array('jquery'));
}
// menus
add_action( 'init', 'menus' );
function menus() {
register_nav_menus(
array(
'desktop-menu' => __( 'Menú Escritorio' ),
'mobile-menu' => __( 'Menú Móvil' )
)
);
}
//
function remove_backend_menus() {
remove_menu_page('edit-comments.php'); //Comments
// remove_menu_page('edit.php'); //Posts
// remove_menu_page('upload.php'); //Media
// remove_menu_page( 'index.php' ); //Dashboard
// remove_menu_page( 'jetpack' ); //Jetpack*
// remove_menu_page( 'edit.php?post_type=page' ); //Pages
// remove_menu_page( 'themes.php' ); //Appearance
// remove_menu_page( 'plugins.php' ); //Plugins
// remove_menu_page( 'users.php' ); //Users
// remove_menu_page( 'tools.php' ); //Tools
// remove_menu_page( 'options-general.php' ); //Settings
}
add_action('admin_menu','remove_backend_menus');
// CPTs
include_once "cpts/slider-home.php";
include_once "cpts/asesoria-juridica.php";
include_once "cpts/abogados.php";
//
// extracto
function get_excerpt(){
$excerpt = get_the_content();
$excerpt = preg_replace(" ([.*?])",'',$excerpt);
$excerpt = strip_shortcodes($excerpt);
$excerpt = strip_tags($excerpt);
$excerpt = substr($excerpt, 0, 50);
$excerpt = substr($excerpt, 0, strripos($excerpt, " "));
$excerpt = trim(preg_replace( '/\s+/', ' ', $excerpt));
$excerpt = $excerpt.'... Leer Más';
return $excerpt;
}