D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home2
/
stickain
/
flyfishing.davidsteele.com
/
wp-content
/
themes
/
david-steele
/
Filename :
functions.php
back
Copy
<?php /** * @author Divi Space * @copyright 2017 */ if (!defined('ABSPATH')) die(); function ds_ct_enqueue_parent() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); } function ds_ct_loadjs() { wp_enqueue_script( 'ds-theme-script', get_stylesheet_directory_uri() . '/ds-script.js', array( 'jquery' ) ); } add_action( 'template_redirect', 'redirect_external_products' ); function redirect_external_products() { global $post; if ( is_singular( 'product' ) && ! empty( $post ) && ( $product = wc_get_product( $post ) ) && $product->is_type( 'external' ) ) { wp_redirect( $product->get_product_url() ); exit; } } add_filter('woocommerce_single_product_image_link', 'change_product_image_link', 10, 2); function change_product_image_link($image_link, $product) { if ($product->is_type('external')) { global $post; return esc_url($product->get_product_url()); } return $image_link; } add_action( 'wp_enqueue_scripts', 'ds_ct_enqueue_parent' ); add_action( 'wp_enqueue_scripts', 'ds_ct_loadjs' ); add_action( 'woocommerce_after_add_to_cart_button', 'trust_img', 20 ); function trust_img() { echo '<img class="aligncenter size-full wp-image-2656" src="https://gunlovers.davidsteele.com/wp-content/uploads/2017/11/trust-icons.jpg" alt="trust icons for david steele" width="400" height="94" /><br/>'; } add_action( 'woocommerce_after_add_to_cart_button', 'trust_img2', 21 ); function trust_img2() { echo '<img class="aligncenter size-full wp-image-4651" src="https://davidsteele.com/wp-content/uploads/2017/11/3-smart-reason.png" alt="trust icons for david steele" width="381" height="136" /><br/>'; } include('login-editor.php'); add_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart', 10); // BEGIN ENQUEUE PARENT ACTION // AUTO GENERATED - Do not modify or remove comment markers above or below: if ( !function_exists( 'chld_thm_cfg_locale_css' ) ): function chld_thm_cfg_locale_css( $uri ){ if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) ) $uri = get_template_directory_uri() . '/rtl.css'; return $uri; } endif; add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' ); // END ENQUEUE PARENT ACTION