- Copy
phpinfo()output and paste it into Xdebug Wizard. - Download
xdebug.dll. - Copy the DLL to your PHP
extfolder. - Add the following configuration to your
php.ini:
- Copy
phpinfo()output and paste it into Xdebug Wizard. - Download
xdebug.dll. - Copy the DLL to your PHP
extfolder. - Add the following configuration to your
php.ini:
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
| ## BEGIN EXPIRES CACHING ## | |
| <IfModule mod_expires.c> | |
| ExpiresActive on | |
| # Perhaps better to whitelist expires rules? Perhaps. | |
| ExpiresDefault "access plus 1 year" | |
| # cache.appcache needs re-requests in FF 3.6 (thanks Remy ~Introducing HTML5) | |
| ExpiresByType text/cache-manifest "access plus 0 seconds" |
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
| // Method 1 | |
| window.addEventListener('load', function() { | |
| var theHash = location.hash; | |
| // add offset only for specific hashes | |
| var hashes = ['#project-togo', '#project-colombia-visajes', '#project-colombia-izquierdo', '#project-yemen', '#project-tansania']; | |
| if (hashes.includes(theHash)) { | |
| window.scrollBy(0, -100); | |
| } | |
| }); |
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 | |
| // Get current user's location | |
| $geo_data = WC_Geolocation::geolocate_ip(); | |
| $country = $geo_data['country']; | |
| $state = $geo_data['state']; | |
| // Use a specific IP address | |
| $location = WC_Geolocation::geolocate_ip( '8.8.8.8' ); |
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 | |
| // Method 1: Using JUri (Recommended) | |
| // Get the full current URL | |
| $currentUrl = JUri::getInstance()->toString(); | |
| // Get only the base URL (without query parameters) | |
| $baseUrl = JUri::base(); | |
| // Get the current URI 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
| <?php | |
| /** | |
| * The template for displaying product content within loops | |
| * | |
| * This template can be overridden by copying it to yourtheme/woocommerce/content-product.php. | |
| * | |
| * HOWEVER, on occasion WooCommerce will need to update template files and you | |
| * (the theme developer) will need to copy the new files to your theme to | |
| * maintain compatibility. We try to do this as little as possible, but it does | |
| * happen. When this occurs the version of the template file will be bumped and |
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
| // GET Request: | |
| fetch('https://api.example.com/data') | |
| .then(response => response.json()) | |
| .then(data => console.log(data)) | |
| .catch(error => console.error('Failed to fetch data', error)); | |
| // POST Request: | |
| fetch('https://api.example.com/data', { | |
| method: 'POST', |
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 is_wc_cart_block_based() { | |
| $cart_page_id = wc_get_page_id( 'cart' ); | |
| if ( $cart_page_id && $cart_page = get_post( $cart_page_id ) ) { | |
| // Check for WooCommerce Cart block | |
| return has_block( 'woocommerce/cart', $cart_page ); | |
| } | |
| return false; | |
| } |
NewerOlder