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 global $current_user; if ( isset($current_user) ) { echo "Seja bem-vindo, "; echo $current_user->user_login; } ?> | |
<?php global $user_ID; | |
if($user_ID) { | |
echo '<class="login"><a href="' . site_url('minha-conta/logout/', 'login') . '">' . __('(Sair)', 'atahualpa') . '</a>'; | |
} else { | |
echo '<class="login"><a href="' . site_url('minha-conta/', 'login') . '">' . __('Faça seu Login', 'atahualpa') . '</a>'; | |
} ?> | |
<?php global $current_user; if ( isset($current_user) ) { echo "ou "; } ?> | |
<?php global $user_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
<?php | |
// Benefícios | |
add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' ); | |
function woo_new_product_tab( $tabs ) { | |
// Adds the new tab | |
$tabs['beneficios'] = array( |
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 global $post;echo get_post_meta($post->ID, 'name', true);?> |
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 | |
// Search Filter xD | |
function fb_search_filter($query) { | |
if ( !$query->is_admin && $query->is_search) { | |
$query->set('post__not_in', array(557,30,4,598,682) ); // id of page or post | |
} | |
return $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
<?php | |
// Display 12 products per page. | |
add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 12;' ), 20 ); |
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
<ul class="products"> | |
<?php | |
$args = array( | |
'post_type' => 'product', | |
'posts_per_page' => 12 | |
); | |
$loop = new WP_Query( $args ); | |
if ( $loop->have_posts() ) { | |
while ( $loop->have_posts() ) : $loop->the_post(); | |
woocommerce_get_template_part( 'content', 'product' ); |
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 global $current_user; if ( isset($current_user) ) { echo "Seja bem-vindo, "; echo $current_user->user_login; } ?> | |
<?php global $user_ID; | |
if($user_ID) { | |
echo '<class="login"><a href="' . site_url('minha-conta/logout/', 'login') . '">' . __('(Sair)', 'atahualpa') . '</a>'; | |
} else { | |
echo '<class="login"><a href="' . site_url('minha-conta/', 'login') . '">' . __('Faça seu Login', 'atahualpa') . '</a>'; } ?> | |
<?php global $current_user; if ( isset($current_user) ) { echo "ou "; } ?> | |
<?php global $user_ID; | |
if($user_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
UPDATE wp_options SET option_value = replace(option_value, 'http://url-antiga.com.br', 'http://url-nova.com.br') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://url-antiga.com.br','http://url-nova.com.br'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://url-antiga.com.br', 'http://url-nova.com.br'); |
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 if( have_posts() ) : while( have_posts() ) : the_post(); | |
$posts = get_posts(array( | |
"showposts" => -1, | |
"what_to_show" => "posts", | |
"post_status" => "inherit", | |
"post_type" => "attachment", | |
"orderby" => "menu_order", | |
"order" => "ASC", | |
"posts_per_page" => 1, | |
"post_mime_type" => "image/jpeg,image/gif,image/jpg,image/png", |
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 | |
// Edit in "wp-admin\includes\file.php" | |
// of: if | |
if ( false === @ move_uploaded_file( $file['tmp_name'], $new_file) ) { | |
// for: |
OlderNewer