__('Main Menu', 'Lidra'), 'footer_nav' => __('Footer Menu', 'Lidra') ); register_nav_menus($locations); } add_action('after_setup_theme', 'libre_custom_theme_setup'); // Funcion de reemplazo a leer más function read_more( $more ){ $url_post = get_permalink(); return " " . __('Read more...', 'Lidra') . ""; } add_filter('excerpt_more', 'read_more'); // Funcion de widget function widgets_activation(){ register_sidebar( array( 'name' => __('Sidebar', 'Lidra'), 'id' => 'sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

' )); } add_action('widgets_init', 'widgets_activation'); //Agrega iconos por defecto de WordPress function load_dashicons_front_end() { wp_enqueue_style( 'dashicons' ); } add_action( 'wp_enqueue_scripts', 'load_dashicons_front_end' ); /*Ajustes y Limpieza para WordPress ------------------------------------------------------------------------------*/ //Elimina referencias a la version de WordPress function quitar_version_wp() { return ''; } add_filter('the_generator', 'quitar_version_wp'); function nowp_head_cleanup() { // Eliminamos lo que sobra de la cabecera remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wp_generator'); remove_action('wp_head', 'feed_links', 2); remove_action('wp_head', 'index_rel_link'); remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'feed_links_extra', 3); remove_action('wp_head', 'start_post_rel_link', 10, 0); remove_action('wp_head', 'parent_post_rel_link', 10, 0); remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0); remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0); remove_action('wp_head', 'feed_links', 2); remove_action('wp_head', 'feed_links_extra', 3); // Elimina emoji script remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); remove_action( 'wp_print_styles', 'print_emoji_styles' ); global $wp_widget_factory; remove_action('wp_head', array( $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style') ); if (!class_exists('WPSEO_Frontend')) { remove_action('wp_head', 'rel_canonical'); add_action('wp_head', 'nowp_rel_canonical'); } } function nowp_rel_canonical() { global $wp_the_query; if (!is_singular()) { return; } if (!$id = $wp_the_query->get_queried_object_id()) { return; } $link = get_permalink($id); printf("\n"); } add_action('init', 'nowp_head_cleanup'); // Limpia dns-prefetch en caso de NO usar fuentes del servicio Privativo Google function remove_dns_prefetch( $hints, $relation_type ) { if ( 'dns-prefetch' === $relation_type ) { return array_diff( wp_dependencies_unique_hosts(), $hints ); } return $hints; } add_filter( 'wp_resource_hints', 'remove_dns_prefetch', 10, 2 ); /* LibreVideoJS ------------------------------------------------------------------------------*/ include_once 'librevideojs/librevideojs.php';