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 '
' . ( $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'); ?>