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 // Ignore this first line when copying to your child theme's functions.php file. | |
/** | |
* Disable Popup Maker if Using Divi Builder | |
* | |
* Reference https://github.com/stefanoferrario/Extra/blob/e5eb5b20e6165ee989b8538f8eebbcddd24ce4b7/core/functions.php#L353 | |
*/ | |
add_action( 'wp', function() { | |
if ( ! function_exists( 'et_core_is_fb_enabled' ) ) return; |
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
Extensions | |
========== | |
ext install wakatime.vscode-wakatime (time tracking) | |
ext install esbenp.prettier-vscode (prettifier) | |
ext install ms-vscode.csharp (C#) | |
ext install mikestead.dotenv (.env files) | |
ext install msjsdiag.debugger-for-chrome (chrome's debugger) | |
ext install deerawan.vscode-faker (faker) | |
ext install ms-vsliveshare.vsliveshare (shared coding sessions) |
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 the following to your `functions.php` | |
```php | |
function vc_before_init_actions() { | |
require_once( get_template_directory().'/functions/shortcodes/vc-text-image.php' ); | |
} | |
add_action( 'vc_before_init', 'vc_before_init_actions' ); | |
``` | |
And now create a file in the location specified above with the following (customise accordingly): |
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 | |
/* | |
################### READ ME ################################# | |
You'll pass the URL to your feed/file to this function inside the "Download from URL" option when creating an import. | |
Image examples: https://d.pr/hCfNek and https://d.pr/MnerNb. | |
1. [custom_file_download("ftp://username:[email protected]/full/path/to/file.csv","csv")] | |
2. [custom_file_download("http://example.com/full/path/to/file.csv","csv")] |
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
.acf-fc-popup .preview { | |
position: absolute; | |
right: 100%; | |
margin-right: 0px; | |
top: 0; | |
background: #383c44; | |
min-height: 100%; | |
border-radius: 5px; | |
align-content: center; | |
display: grid; |
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
{ | |
// ECHO | |
"PHP Echo Tag": { | |
"prefix": "echo", | |
"body": [ | |
"<?php echo ${1:\\$var}; ?>" | |
], | |
"description": "Expand \"echo\" into PHP echo block" | |
}, | |
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
<div id="container"> | |
<?php | |
// simple but effective for string outputting to html page | |
function esc($s){ | |
return htmlentities(trim($s), ENT_QUOTES, 'UTF-8'); | |
} | |
function countFolder($dir) { | |
$get = (count(scandir($dir)) - 2); | |
if ($get == -2) { |
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 | |
/* | |
This script will allow you to send a custom email from anywhere within wordpress | |
but using the woocommerce template so that your emails look the same. | |
Created by [email protected] on 27th of July 2017 | |
Put the script below into a function or anywhere you want to send a custom email | |
*/ |
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 acf_set_featured_image( $value, $post_id, $field ){ | |
if($value != '' && 'location' == get_post_type()){ | |
//Add the value which is the image ID to the _thumbnail_id meta data for the current post | |
update_post_meta($post_id, '_thumbnail_id', $value); | |
} | |
return $value; |
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 // Don't copy this line if you are inserting in a file that has it already. | |
/** | |
* ACF Options Page | |
* | |
* Instructions: | |
* Add more languages to the array below: $languages | |
* | |
* @author: Zeshan Ahmed <https://zeshanahmed.com/> | |
*/ |
NewerOlder