Skip to content

Instantly share code, notes, and snippets.

@bigdigital
bigdigital / style.css
Created February 13, 2017 08:35
Change side header order The7
.header-bar{
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}
.header-bar .branding{
-webkit-box-ordinal-group: 2;
@bigdigital
bigdigital / functions.php
Last active February 16, 2017 13:52
Change logout url in the7 theme
//add this to your functions.php of main or child theme
add_filter( 'logout_url', 'custom_logout_url',10, 2 );
function custom_logout_url( $logout_url, $redirect )
{
//Uncomment one of theese return statements
//1.link to current page
$args = array( 'redirect_to' => get_permalink() );
//link to static logout page (set your URL here)
//$args 'http://example/my-account/customer-logout/';
@bigdigital
bigdigital / functions.php
Last active February 17, 2017 08:29
Change default Google font URL in The7 theme
function my_dt_make_web_font_uri( $font, $effect = '' ) {
if ( !$font ) {
return false;
}
// add web font effect
if ( function_exists('dt_get_web_fonts_effects') ) {
if ( array_key_exists( $effect, dt_get_web_fonts_effects() ) ) {
$effect = '&effect=' . esc_attr( $effect );
@bigdigital
bigdigital / functions.php
Last active May 11, 2017 09:17
Fix to update The7 v4 theme options (object cache)
if ($optionsframework_settings = get_option( 'optionsframework' ) && !function_exists('optionsframework_update_options_cache') )
add_action( 'update_option_' . $optionsframework_settings['id'], 'optionsframework_update_options_cache_fix', 10, 2 );
function optionsframework_update_options_cache_fix( $old_value, $value ) {
$value = apply_filters( 'dt_of_get_option_static', $value );
wp_cache_set( 'saved_options', $value, 'optionsframework' );
}
@bigdigital
bigdigital / functions.php
Created February 21, 2017 13:58
Add custom font in The7 theme
function add_custom_font( $fonts ) {
$fonts['Fibon'] = 'Fibon';
return $fonts;
}
add_filter( 'presscore_options_get_safe_fonts', 'add_custom_font' ,30 , 1 );
@bigdigital
bigdigital / functions.php
Last active July 12, 2017 08:18
The7 Borders around the site
//add this code to functions.php of your main or child theme
function presscore_render_paspartu() {
?><div class="paspartu_top"></div><?php
}
add_action( 'presscore_body_top', 'presscore_render_paspartu', 40 );
define('THE7_DEBUG', true);
define( 'FS_METHOD', 'direct' );
@bigdigital
bigdigital / functions.php
Created March 7, 2017 10:27
The7 integration Google Tag Manager
function add_after_body()
{
?>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<?php
}
function move_price_location() {
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10);
add_action( 'woocommerce_after_single_product_summary', 'woocommerce_template_single_price', 50);
}
add_action( 'init', 'move_price_location' );