Definir constantes para evitar llamadas redundantes:
define('HOME_URI', get_bloginfo('url')); define('THEME_URI', get_stylesheet_directory_uri()); define('THEME_URI_STATICS', 'http://s1.otroblogmas.com/'); define('THEME_URI_IMAGES', THEME_URI_STATICS . 'img'); define('THEME_URI_MULTIMEDIA', 'http://m1.otroblogmas.com/'); |
Recorrer todos los hooks:
add_action( 'all', create_function( '', 'var_dump( current_filter() );' ) ); |
Cambiar el origen de jQuery;
if ( !is_admin() ) { wp_deregister_script('jquery'); wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"), false); wp_enqueue_script('jquery'); } |
Limpiar el head:
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); |
Redirigir la paginación de la HOME que no existe, para que sea 404:
/** * Redirect the pages that they must be 404 errors. */ function paginated_home_that_doesnt_exist( $template ) { global $wp_query; if ( is_home() && 0 == $wp_query->post_count) { $template = get_404_template(); status_header( 404 ); } return $template; } add_filter( 'template_include', 'paginated_home_that_doesnt_exist'); |
Redireccionar URLs de categorías que estan mal estructuradas:
/** * If the URL and canonical are differents, redirects to canonical URL */ function redirect_page_to_canonical_url () { if ( is_category() && !is_admin() ) { $category = current( get_the_category() ); $correctUrl = get_category_link( $category->term_id ); if ( is_paged() ) { $num = get_query_var( 'paged' ); $correctUrl .= '/page/' . $num; } $currentUrl = 'http://' . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]; if ( $currentUrl != $correctUrl ) { wp_redirect( $correctUrl, 301 ); } } } add_filter('wp', 'redirect_page_to_canonical_url'); |
Redirecciona al post cuando la búsqueda da solo un resultado:
/** * Redirects the page to a post in only-one search results * * @global array $wp_query */ function redirect_search_result_with_one_post () { if (is_search() && !is_admin()) { global $wp_query; if (1 == $wp_query->post_count) { wp_redirect(get_permalink($wp_query->posts['0']->ID)); } } } add_action('wp', 'redirect_search_result_with_one_post'); |
Redirecciona al post cuando la tag solo tiene un post asignado:
/** * Redirect the tags that only have one post. * * @global WP_Query $wp_query */ function redirect_tags_with_one_post() { global $wp_query; if ( is_tag() && 1 == $wp_query->post_count) { $url = get_permalink( get_the_ID() ); wp_redirect( $url ); } } add_action( 'wp', 'redirect_tags_with_one_post' ); |
Simply on-line bank points out … love the pictures!
I attempt to find out by looking at other photos, also. https://www.minds.com/elreviewz77/
Tremendous things here. I am very happy to
see your post. Thanks so much and I’m taking a look forward to touch you.
Will you kindly drop me a mail? https://www.minds.com/apartments1/