ID, 'redirect', true) ) { echo status_header(301); header("Location: $meta"); exit; } } } /** * Evita enviar pings al posts del mateix lloc. * @author Michael D. Adams * @link http://blogwaffe.com/2006/10/04/421/ * @version 0.2 * * @param array $links Llista de llocs on es farà ping */ function no_self_ping( &$links ) { $home = get_option( 'home' ); foreach ( $links as $l => $link ) if ( 0 === strpos( $link, $home ) ) unset($links[$l]); } add_action( 'pre_ping', 'no_self_ping' ); /** * Converteix les dates mySQL al Català. * S'utilitza com a modificador Smarty. * * @param string $date Data en format mySQL. * @param bool $display Si volem que es faci echo del resultat o no. * @return string Data en Català. Ex. 13 de Gener de 1963. */ function tx_sql2date( $date, $display = true ) { $months = array( 1 => 'de Gener', 2 => 'de Febrer', 3 => 'de Març', 4 => "d'Abril", 5 => 'de Maig', 6 => 'de Juny', 7 => 'de Juliol', 8 => "d'Agost", 9 => 'de Setembre', 10 => "d'Octubre", 11 => 'de Novembre', 12 => 'de Desembre'); $y = intval(substr($date, 0, 4)); $m = intval(substr($date, 5, 2)); $d = intval(substr($date, 8, 2)); $time = substr($date, 11,5); $newdate = "{$d} {$months[$m]} de {$y} | {$time}h"; if ( $display ) { echo $newdate; } return $newdate; } /** * Draws the posts navigator bar * * @param string $class CSS class style */ function theme_post_navigator( $class = '' ) { global $posts; $naviclass = ( empty($class) ) ? 'navigator' : "navigator {$class}"; if ( is_single () ) { ?>
'; wp_pagenavi(); echo ''; } else { global $wp_query; if ( $wp_query->found_posts > get_option('posts_per_page') || is_paged()) { ?>
'; } add_action('admin_head', 'theme_admin_favicon'); /** * Sets the styles for the WordPress Gallery. * * @param string $style Default WordPress styles * @return string New theme styles */ function theme_gallery_style( $style ) { $style = "