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 | |
/** | |
* Filter image src if the attachment parent post is woocommerce product then change its | |
* image src as desired. | |
* | |
* @param array|false $image | |
* @param int $attachment_id | |
* @param string|array $size | |
* @param bool $icon |
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 | |
/** | |
* Add WCC contest details into the WP Rest API | |
* | |
* @param [class] $object Query Object. | |
* @return string Contest details. | |
*/ | |
function get_wcc_contest_details( $object ) { | |
$wcc_contest_details = get_post_meta( $object['id'], '_wcc_contest_details', true ); |
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 | |
/** | |
* Enqueue Site Files for child theme. | |
* | |
* @return void | |
*/ | |
function dvc_theme_enqueue_styles() { | |
wp_enqueue_style( 'divi-parent-style', get_template_directory_uri() . '/style.css' ); | |
} |
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 | |
/** | |
* Filter image attributes if the attachment parent post is woocommerce product then change its | |
* image attributes as desired. | |
* | |
* @param array $attr Attributes for the image markup. | |
* @param WP_Post $attachment Image attachment post. | |
* @param string|array $size Requested size. Image size or array of width and height values | |
* (in that order). Default 'thumbnail'. | |
* @return array $image Modified Image attributes |
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 | |
/** | |
* Utilize Native Divi Social media icons and convert it to a wordpress shortcode. | |
* | |
* @return string html social media list. | |
*/ | |
function divi_social_icons_func() { | |
$social_media = ''; | |
$link_class_name = ''; | |
$social_links = 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
/*** Responsive Styles Large Desktop And Above ***/ | |
@media all and (min-width: 1405px) { | |
} | |
/*** Responsive Styles Standard Desktop Only ***/ | |
@media all and (min-width: 1100px) and (max-width: 1405px) { | |
} | |
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 | |
// CSS | |
$css_file_path = get_template_directory_uri() . '/assets/css/website-responsive.css'; | |
wp_enqueue_style( | |
'site_responsive', | |
$css_file_path, | |
false, | |
filemtime( $css_file_path ) | |
); |
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
/*-------------------------------------------------------------- | |
>>> TABLE OF CONTENTS: | |
---------------------------------------------------------------- | |
1.0 Base | |
2.0 Header | |
3.0 Footer | |
--------------------------------------------------------------*/ | |
/*-------------------------------------------------------------- | |
1.0 Base |
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 | |
function themeprefix_redirect_user() | |
{ | |
if( is_page( 'login' ) && ! is_user_logged_in() ) | |
{ | |
wp_redirect( home_url( '/signup/' ) ); | |
die; | |
} | |
} |
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 | |
/** | |
* Truncate a string provided by the maximum limit. | |
* @param string $str | |
* @param integer $maxlen | |
* @return string | |
*/ | |
function limitString($string, $limit = 100, $end = '…') | |
{ |