Skip to content

Instantly share code, notes, and snippets.

View inakicalvo's full-sized avatar

Iñaki Calvo Sánchez inakicalvo

  • Barcelona
  • 00:34 (UTC +02:00)
View GitHub Profile
.product-page-subtitle {
float: right;
width: 48%;
clear: none;
}
@inakicalvo
inakicalvo / functions.php
Created September 7, 2019 08:16
Add product subtitle in Woocommerce product pages
// Add product subtitle in product pages
add_action( 'woocommerce_before_single_product_summary', 'add_product_subtitle_in_product_page', 40 );
function add_product_subtitle_in_product_page() {
if (function_exists('the_field')){
if (get_field('subtitulo')){
echo '<span class="product-subtitle">', the_field('subtitulo'), '</span>';
}
}
}
.product-subtitle {
color: #666;
font-size: 0.8em;
}
@inakicalvo
inakicalvo / functions.php
Created September 7, 2019 08:12
Add product subtitle in Woocommerce product archives
// Add product subtitle in archives
add_action( 'woocommerce_after_shop_loop_item_title', 'add_product_subtitle_in_archive', 40 );
function add_product_subtitle_in_archive() {
if (function_exists('the_field')){
if (get_field('subtitulo')){
echo '<span class="product-subtitle">', the_field('subtitulo'), '</span>';
}
}
}
// Eliminar product meta de la página de producto en Woocommerce
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );
@inakicalvo
inakicalvo / functions.php
Created May 8, 2018 13:33
Talenland theme
<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
/* This snippet removes the action that inserts thumbnails to products in teh loop
* and re-adds the function customized with our wrapper in it.
* It applies to all archives with products.
*