This file contains hidden or 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( 'init', 'register_new_menu' ); | |
function register_new_menu() { | |
register_nav_menus(); | |
} |
This file contains hidden or 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( 'init', 'remove_excerpt_share' ); | |
function remove_excerpt_share() { | |
if ( has_filter( 'the_excerpt', 'sharing_display' ) ) { | |
remove_filter( 'the_excerpt', 'sharing_display', 19 ); | |
} | |
} |
This file contains hidden or 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 header( 'Content-type: text/xml' ) ?> | |
<?php echo '<?xml version="1.0"?>' ?> | |
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0"> | |
<channel> | |
<title><?php echo bloginfo( 'name' ) ?></title> | |
<link><?php echo home_url() ?></link> | |
<description><?php echo bloginfo( 'description' ) ?></description> | |
<?php | |
$query = new WP_Query( array( |
This file contains hidden or 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
This XML file does not appear to have any style information associated with it. The document tree is shown below. | |
<rss xmlns:g="http://base.google.com/ns/1.0" version="2.0"> | |
<channel> | |
<title>Example - Online Store</title> | |
<link>http://www.example.com</link> | |
<description> | |
This is a sample feed containing the required and recommended attributes for a variety of different products | |
</description> | |
<!-- | |
First example shows what attributes are required and recommended for items that are not in the apparel category |
This file contains hidden or 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
# Google_Product_Taxonomy_Version: 2015-02-19 | |
772 - Adultos | |
780 - Adultos > Armas | |
2214 - Adultos > Armas > Acessórios e cuidados para armas | |
503026 - Adultos > Armas > Acessórios e cuidados para armas > Acessórios e equipamentos de recarga | |
499857 - Adultos > Armas > Acessórios e cuidados para armas > Acessórios e equipamentos de recarga > Prensas para recarga de munição | |
505762 - Adultos > Armas > Acessórios e cuidados para armas > Caixas e suportes de munição | |
1822 - Adultos > Armas > Acessórios e cuidados para armas > Canhões elétricos | |
1783 - Adultos > Armas > Acessórios e cuidados para armas > Coldres para armas | |
499853 - Adultos > Armas > Acessórios e cuidados para armas > Correias para armas |
This file contains hidden or 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 | |
wp_login_form( array( | |
'redirect' => home_url(), | |
'label_username' => 'User', | |
'label_password' => 'Password', | |
'id_username' => 'user_login', | |
) ); |
This file contains hidden or 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( 'wp_loaded', 'add_role_client' ); | |
function add_role_client() { | |
add_role( 'client', 'Client', array( | |
'read' => true | |
) ); | |
} |
This file contains hidden or 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
<? | |
var_dump( get_queried_object() ); | |
/*OR*/ | |
$terms = get_the_terms( get_the_ID(), 'taxonomy'); | |
/* |
This file contains hidden or 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 to cart redirect to checkout. | |
* | |
* @param string $url | |
* @return string | |
*/ | |
function my_wc_add_to_cart_redirect_to_checkout( $url ) { | |
return wc_get_checkout_url(); |
This file contains hidden or 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 | |
foreach ( get_categories( array( 'orderby' => 'name', 'order' => 'ASC' ) ) as $category ) { | |
$posts = get_posts( array( | |
'showposts' => -1, | |
'category__in' => array( $category->term_id ), | |
'ignore_sticky_posts' => 1 | |
) ); | |
if ( $posts ) { | |
echo '<h4>' . __( 'Categoria:' ) . ' <a href="' . get_category_link( $category->term_id ) . '">' . $category->name . '</a></h4>'; | |
foreach ( $posts as $post ) { |