Skip to content

Instantly share code, notes, and snippets.

View cdsaenz's full-sized avatar

charly cdsaenz

View GitHub Profile
@cdsaenz
cdsaenz / README.md
Created March 20, 2024 21:04 — forked from AmmarCodes/README.md
WordPress: link to specific elementor tab on a specific page

It's a quick ad-hoc solution to allow you to link to your page to a specific tab from elementor tabs widget.

Here's the catch, you need to replace the id of the specific tab you want to use to not contain the title- part.

Use https://your-website/#elementor-tab-1515

instead of: https://your-website/#elementor-tab-title-1515

@cdsaenz
cdsaenz / index.html
Created March 6, 2024 12:14 — forked from iosifnicolae2/index.html
Whatsapp Floating Button
<a href="https://wa.me/40123456789?text=hi" style="
position: fixed;
width: 60px;
height: 60px;
bottom: 32px;
right: 33px;
background-color: #25d366;
color: #FFF;
border-radius: 50px;
text-align: center;
@cdsaenz
cdsaenz / class-jwt.php
Created September 26, 2023 00:25 — forked from davisshaver/class-jwt.php
WordPress/Coral Project Talk JWT integration
<?php
use \Firebase\JWT\JWT as JWT_Wrapper;
/**
* Class wrapper for JWT tokens.
*/
class JWT {
use Singleton;
@cdsaenz
cdsaenz / mailchimp-curl.php
Created June 16, 2023 16:42 — forked from iloveitaly/mailchimp-curl.php
MailChimp PHP API using CURL
<?php
class Mailchimp_Core {
var $version = "1.3";
var $errorMessage;
var $errorCode;
/**
* Cache the information on the API location on the server
*/
@cdsaenz
cdsaenz / card.php
Created May 13, 2023 21:31 — forked from Niq1982/card.php
Load more to WordPress blog archive using AlpineJS and Axios
<div class="card">
<?php if ($args['link']) : ?>
<a href="<?php echo esc_url($args['link']); ?>" class="global-link">
</a>
<?php endif; ?>
<div class="card-image">
<?php wp_get_attachment_image($args['image']); ?>
</div>
@cdsaenz
cdsaenz / wpinstall.sh
Created January 18, 2023 18:40 — forked from fmtarif/wpinstall.sh
#wp #bash #cli Install and initial set up for WordPress sites (uses WP-CLI)
#!/bin/bash
# get wp-cli
# curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && chmod +x wp-cli.phar && sudo mv wp-cli.phar /usr/local/bin/wp
# wp-cli auto-completion
# wget https://raw.githubusercontent.com/wp-cli/wp-cli/master/utils/wp-completion.bash && source wp-completion.bash && echo -e "\nsource wp-completion.bash" >> .bashrc
#verify if wp-cli correctly installed
# wp --info
@cdsaenz
cdsaenz / 01-common-example.php
Created November 14, 2022 17:29 — forked from westonruter/01-common-example.php
Temporarily disabling filters in WordPress
<?php // Common way to do it:
remove_filter( 'the_title', 'wptexturize' );
$title = get_the_title();
add_filter( 'the_title', 'wptexturize' );
@cdsaenz
cdsaenz / Woo_WC_Product_Variable.php
Created October 4, 2022 00:51 — forked from gorkamu/Woo_WC_Product_Variable.php
Extended Woocommerce Variation Class
<?php
class Woo_WC_Product_Variable extends WC_Product_Variable {
public function get_all_variations() {
$available_variations = array();
foreach($this->get_children() as $child_id){
$variation = wc_get_product($child_id);
$available_variations[] = $this->get_available_variation($variation);
}
@cdsaenz
cdsaenz / .htaccess
Created September 29, 2022 23:16 — forked from thehashrocket/.htaccess
.htaccess file for CodeIgniter
AddDefaultCharset utf-8
# AddHandler php5-script .php
# AddHandler php4-script .php
# AddHandler php5-cgi .php
# Use PHP5 as default
AddHandler application/x-httpd-php5 .php
@cdsaenz
cdsaenz / VSCode-Regex-Search-Replace-Markdown-Images
Created September 29, 2022 18:37 — forked from dixonge/VSCode-Regex-Search-Replace-Markdown-Images
Regex to find markdown images and replace with img tag in VS Code (or template engine shortcode, etc.)
Find: !\[(.*?)\]\((.*?)\)
Replace: <img alt="$1" src="$2">