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 | |
/* | |
* Remove "Add to Cart", il conteggio risultati e l'ordinamento | |
*/ | |
add_action('wp', 'misha_remove_add_to_cart_product_categories' ); | |
function ek_woo_rimuovo(){ | |
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart'); | |
remove_action( 'woocommerce_before_shop_loop' , 'woocommerce_result_count', 20 ); | |
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); |
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 | |
$args = array( | |
'post_type' => 'post', | |
'posts_per_page' => '-1' | |
); | |
$query = new WP_Query( $args ); | |
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); ?> | |
<?php endwhile; ?> |
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 | |
//per aggiornare le pagine viste | |
gt_set_post_view(); | |
//per stampare il numero di visite | |
echo gt_get_post_view(); | |
?> |
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 $args = get_query_var('var_post'); ?> | |
<article class="post"> | |
<h3><a href="<?php echo get_the_permalink(); ?>"><?php the_title(); ?></a></h3> | |
<?php echo the_excerpt(); ?> | |
<?php echo var_post['foo']; ?> | |
</article> |
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 | |
// prima recupero l'id del termine poi recupero l'oggetto del termine corrente | |
$term = get_queried_object(); //recupero id term corrente | |
$tax_name = get_term_by( 'term_id', get_queried_object()->term_id, 'slugTax')->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
Disabilitare Cerca: personalizza > header e navigaizone > elementi header |
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 | |
add_filter('woocommerce_checkout_fields', 'addBootstrapToCheckoutFields' ); | |
function addBootstrapToCheckoutFields($fields) { | |
foreach ($fields as &$fieldset) { | |
foreach ($fieldset as &$field) { | |
// if you want to add the form-group class around the label and the input | |
$field['class'][] = 'form-group'; | |
// add form-control to the actual input | |
$field['input_class'][] = 'form-control'; |
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 | |
//How to Hide Wordfence Security Admin Menus | |
function plt_hide_wordfence_menus() { | |
//Hide "Wordfence 0". | |
remove_menu_page('Wordfence'); | |
//Hide "Wordfence 0 → Dashboard". | |
remove_submenu_page('Wordfence', 'Wordfence'); | |
//Hide "Wordfence 0 → Firewall". | |
remove_submenu_page('Wordfence', 'WordfenceWAF'); | |
//Hide "Wordfence 0 → Scan". |
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 | |
//aggiungo custom post type su cui effettuare la ricerca | |
function ek_add_post_type_to_search( $query ) { | |
if ( is_admin() || ! $query->is_main_query() ) { | |
return; | |
} | |
if ( $query->is_search() ) { | |
$query->set( | |
'post_type', |
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
<form class="searchform" role="search" method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>"> | |
<input class="form-control search-autocomplete" type="text" value="<?php echo get_search_query(); ?>" placeholder="cerca" name="s" id="s"> | |
<input type="hidden" name="post_type" value="prodotti" /> | |
<button type="submit" id="searchsubmit" value="<?php esc_attr_x('Search', 'bst') ?>">Cerca</button> | |
</form> |