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
get_thumbnail_image_src() { | |
/** | |
* @todo | |
* * Return or echo | |
* | |
* | |
*/ | |
global $post; | |
if ( has_post_thumbnail( $post->ID ) ) { |
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
// More info: http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts | |
function hide_cat_home_query ( $query ) { | |
if ( $query->is_home() && $query->is_main_query() ) { | |
$the_cat_id = get_cat_ID('cat_name'); | |
$query->set('cat', '-'.$the_cat_id); | |
} | |
} | |
add_action('pre_get_posts', 'hide_cat_home_query'); |
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
update wp_term_taxonomy set taxonomy = 'category' | |
where term_id in ( | |
select a.term_id | |
from wp_terms a | |
where a.name in ( | |
'cat_name' | |
) | |
) |
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
function get_page_parent_number( $pagina = null ) { | |
$n = 0; | |
while ( $pagina->post_parent != 0 ) { | |
$pagina = get_page( $pagina->post_parent ); | |
++$n; | |
} | |
return $n; | |
} |
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
function lets_redirect( $query ) { | |
if ( !is_admin() ) { | |
if ( $query->is_page() && $query->is_main_query() ) { | |
$redirection = get_post_meta( $query->queried_object->ID, 'url_to_go', true ); | |
if ( $redirection != '' ) { | |
?> | |
<script language="javascript" type="text/javascript"> | |
window.location.href="<?php echo $redirection ?>"; | |
</script> | |
<?php |
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
add_filter( 'show_admin_bar', '__return_false' ); | |
remove_action( 'init', 'wp_admin_bar_init' ); |
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
$args = array( | |
'category_name' => 'slug', | |
'posts_per_page'=> 20 | |
); | |
$mis_posts = new WP_Query( $args ); | |
while ( $mis_posts->have_posts() ) { | |
$mis_posts->the_post(); | |
/** |
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
<select name="dia" id="dia"> | |
<option value=""></option> | |
<?php | |
$i = 1; | |
while ( $i <= 31 ) { | |
if ( $i < 10 ) { | |
$dia = '0' . $i; | |
} |
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 | |
/* | |
UPDATED: December 31, 2011. | |
Modifications: | |
- Truncated the longest country names, including: | |
-- British Indian Ocean Territories (Chagos Archipelago) -> British Indian Ocean Territories | |
-- South Georgia and the South Sandhich Islands -> South Georgia & S. Sandwich Islands |
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
jQuery('#check-term').bind('change', function() { | |
if(jQuery(this).is(':checked')){ | |
jQuery("#acepta-condiciones").hide(); | |
} | |
else { | |
jQuery("#acepta-condiciones").show(); | |
} | |
}); |
OlderNewer