Function e listagem de Categorias ou Taxonomy com imagens de tamanhos personalizados.
Plugin usado: http://wordpress.org/plugins/categories-images/
<ul> | |
<?php $tags = get_the_tags(); foreach ( (array) $tags as $tag ) { echo '<li><a href="' . get_tag_link($tag->term_id) . '" title="' . $tag->name . '">' . $tag->name . '</a></li>';}?> | |
</ul> |
<ul> | |
<?php $link = get_bookmarks('category=ID-CATEGORIA&orderby=rating'); foreach ($link as $bmark) { $url = $bmark->link_url; ?> | |
<li> | |
<a href="<?php echo $bmark->link_url;?>" title="<?php echo $bmark->link_name;?>." target="<?php echo $bmark->link_target;?>"> | |
<img src="<?php echo $bmark->link_image;?>" alt="<?php echo $bmark->link_name;?>." title="<?php echo $bmark->link_name;?>." /> | |
</a> | |
</li> | |
<?php }; ?> | |
</ul> |
<?php global $post; $category = get_the_category($post->ID); echo $category[0]->name; ?> |
Function e listagem de Categorias ou Taxonomy com imagens de tamanhos personalizados.
Plugin usado: http://wordpress.org/plugins/categories-images/
<?php if(get_post_custom_values('SEU-CUSTOM-FILD')) { foreach(get_post_custom_values('SEU-CUSTOM-FILD') as $suavarivel) { echo wpautop($suavarivel); } } ?> |
<?php | |
$query_args = array( | |
'post_type' => 'product', | |
'product_cat' => SLUG-YOUR-CATEGORY, | |
'post_status' => 'publish', | |
'ignore_sticky_posts' => 1, | |
'posts_per_page' => 3, | |
'meta_query' => array( | |
array( | |
'key' => '_visibility', |
<?php | |
add_filter('the_posts', 'show_future_posts'); | |
function show_future_posts($posts) | |
{ | |
global $wp_query, $wpdb; | |
if(is_single() && $wp_query->post_count == 0) | |
{ | |
$posts = $wpdb->get_results($wp_query->request); |
<?php | |
global $post; | |
$trim_length = 450; //desired length of text to display | |
$summary_excerpt = 'wpcf-breve-descricao'; | |
$value = get_post_meta($post->ID, $summary_excerpt, true); | |
if ($value != '') { | |
if(strlen($value) <= $trim_length){ | |
echo apply_filters('breve-descricao', $value); | |
} else { | |
echo apply_filters('breve-descricao', rtrim(substr($value,0,$trim_length)).'...'); |
<?php | |
/* add rel prettyphoto to all images */ | |
function autoadd_rel_prettyPhoto($content) { | |
global $post; | |
$pattern = "/(<a(?![^>]*?data-rel=['\"]prettyPhoto.*)[^>]*?href=['\"][^'\"]+?\.(?:bmp|gif|jpg|jpeg|png)['\"][^\>]*)>/i"; | |
$replacement = '$1 data-rel="prettyPhoto['.$post->ID.']">'; | |
$content = preg_replace($pattern, $replacement, $content); | |
return $content; | |
} | |
add_filter("the_content","autoadd_rel_prettyPhoto"); |
<?php | |
add_filter( 'wc_add_to_cart_message', 'custom_add_to_cart_message' ); | |
function custom_add_to_cart_message( $product_id ) { | |
$product_id = $_REQUEST[ 'product_id' ]; | |
if ( is_array( $product_id ) ) { | |
$titles = array(); |