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
function holiday_message_before_header() { | |
?> | |
<div class="header-block"> | |
<?php echo do_shortcode( '[block id="YOUR BLOCK NAME"]' ); ?> | |
</div> | |
<?php | |
} | |
add_action( 'flatsome_before_header', 'holiday_message_before_header', 1 ); |
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
/* | |
flatsome [ux-countdown] shortcode usage | |
*/ | |
//Admin side shortcode | |
[ux_countdown year="2019" month="10" day="30" time="15:00"] | |
//Add below in functions.php | |
echo do_shortcode('[ux_countdown year="2019" month="10" day="30" time="15:00"]'); |
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 | |
/* | |
Flatsome Theme Product On-Sale End Counter | |
*/ | |
function display_onsale_product_counter() { | |
global $product; | |
if ( $product->is_on_sale() ) |
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 | |
//flatsome product detail page text after excerpt | |
function display_after_short_description($excerpt) { | |
$add_to_excerpt = $excerpt . "<p style='color:green'>Add anything after excerpt</p>"; | |
return $add_to_excerpt; | |
} |
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
// Place this in a text widget | |
<p class="mb-0"><i class="icon-checkmark cc-checkmark"></i> Worldwide shipping</p> | |
// Aditional CSS Flatsome > Advanced > Custom CSS | |
.icon-checkmark.cc-checkmark { | |
color: #7a9c59; | |
margin-right: 5px; | |
} |
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
if ( ! function_exists( 'flatsome_posted_on' ) ) : | |
// Prints HTML with meta information for the current post-date/time and author. | |
function flatsome_posted_on() { | |
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>'; | |
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) { | |
$time_string = '<time class="entry-date published" datetime="%1$s">%2$s</time><time class="updated" datetime="%3$s">%4$s</time>'; | |
} | |
$time_string = sprintf( $time_string, |
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 | |
//flatsome display text after product detail page image, if product is on sale | |
function display_flatsome_after_product_images() { | |
global $product; | |
if ( $product->is_on_sale() ) | |
{ | |
echo '<div style="color:red; border:1px solid #ccc;">Limited time offer</div>'; | |
} |
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 | |
/** | |
* Custom product field to set low stock threshold | |
* Requires WooCommerce 3.0 | |
*/ | |
function sp_custom_product_stock_threshold_field() { | |
global $post; | |
woocommerce_wp_text_input( 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
/* Add Custom field to WooCommerce product */ | |
add_action( 'woocommerce_product_options_general_product_data', 'wc_custom_add_custom_fields' ); | |
function wc_custom_add_custom_fields() { | |
woocommerce_wp_text_input( array( | |
'id' => '_delivery_field', | |
'label' => __( 'Delivery', 'pvc' ), | |
'description' => __( 'Enter the delivery time in days.', 'pvc' ), | |
'desc_tip' => 'true' | |
) ); | |
} |