Last active
February 15, 2017 23:02
-
-
Save deryckoe/d0018ce9a66de44159b7d2d06c689214 to your computer and use it in GitHub Desktop.
WP Expertos/60/add_action
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php add_action( 'hook', 'funcion', $prioridad, $argumentos ); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php add_filter( 'hook', 'funcion', $prioridad, $argumentos ); ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'the_title', 'print_c', 30, 2 ); | |
add_action( 'the_title', 'print_b', 20, 2 ); | |
add_action( 'the_title', 'print_a', 10, 2 ); | |
function print_c($title, $post_id) { | |
$title .= 'Press'; | |
return $title; | |
} | |
function print_b($title, $post_id) { | |
$title .= 'Word'; | |
return $title; | |
} | |
function print_a($title, $post_id) { | |
$title = ''; | |
return $title; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wp_title', 'hack_wp_title' ); | |
function hack_wp_title( $title ) | |
{ | |
if ( empty( $title ) && ( is_home() || is_front_page() ) ) { | |
$title = get_bloginfo('name') . ' | ' . get_bloginfo('description'); | |
} elseif ( is_archive() ) { | |
$title = get_bloginfo( 'name' ) . ' | Archivo:' . get_the_archive_title() ); | |
} else { | |
$title = get_bloginfo( 'name' ) . ' | ' . get_the_title( get_the_ID() ); | |
} | |
return $title; | |
} ?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'login_enqueue_scripts', 'login_logo' ); | |
function login_logo() { ?> | |
<style type="text/css"> | |
body.login div#login h1 a { | |
background-image: url(<?php echo get_stylesheet_directory_uri(); ?>/assets/img/logo.png); | |
background-size: 100%; | |
width: 155px; | |
height: 55px; | |
padding-bottom: 0px; | |
} | |
</style> <?php | |
} ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment