Skip to content

Instantly share code, notes, and snippets.

View dexit's full-sized avatar
🎯
Focusing

Rihards Mantejs dexit

🎯
Focusing
View GitHub Profile
@dexit
dexit / Yoast_SEO_JS_fix
Created July 1, 2025 17:52 — forked from psorensen/Yoast_SEO_JS_fix
Yoast SEO JS Fix
function yst_clean(a){if(""==a||void 0==a)return"";try{a=jQuery("<div/>").html(a).text(),a=a.replace(/<\/?[^>]+>/gi,""),a=a.replace(/\[(.+?)\](.+?\[\/\\1\])?/g,"")}catch(b){}return a}function ptest(a,b){a=yst_clean(a),a=a.toLowerCase();var c=a.match(b);return null!=c?'<span class="good">Yes ('+c.length+")</span>":'<span class="wrong">No</span>'}function removeLowerCaseDiacritics(a){var b,c=[{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{ba
@dexit
dexit / other-wp-seo.php
Created July 1, 2025 17:52 — forked from crazyyy/other-wp-seo.php
WordPress SEO Yoast improvements
<?php
/**
* Set the custom Open Graph image URL for specific conditions.
* Add custom Twitter Social Share images for Yoast SEO for Archive pages
*
* @param string $image The default Open Graph image URL.
* @return string The custom Open Graph image URL, or the default URL if not found.
*/
function artkai_set_custom_category_og_image($image) {
@dexit
dexit / yoast_seo_breadcrumb_add_woo_shop.php
Created July 1, 2025 17:50 — forked from amboutwe/yoast_seo_breadcrumb_add_woo_shop.php
Multiple examples of how to customize the Yoast SEO breadcrumbs
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/*
* Add shop link to the Yoast SEO breadcrumbs for a WooCommerce shop page.
* Credit: https://wordpress.stackexchange.com/users/8495/rjb
* Last Tested: Apr 20 2017 using Yoast SEO 4.6 on WordPress 4.7.3
*/
add_filter( 'wpseo_breadcrumb_links', 'wpseo_breadcrumb_add_woo_shop_link' );
@dexit
dexit / functions.php
Created June 16, 2025 09:02 — forked from emre-edu-tech/functions.php
Filter to limit or trim product title using characters or words except on Single Product Template
<?php
add_filter( 'the_title', 'shorten_woo_product_title', 10, 2 );
function shorten_woo_product_title( $title, $id ) {
if (!is_singular(array('product')) && get_post_type($id) === 'product') {
// return substr( $title, 0, 30) . '…'; // change last number to the number of characters you want
return wp_trim_words($title, 4); // last number = words
} else {
return $title;
}
}
@dexit
dexit / cpt-metabox.php
Created June 12, 2025 12:40 — forked from jonshipman/cpt-metabox.php
Custom Post Type Metabox Class
<?php
/**
* Custom Post Type Meta Box.
*
* @package Heartland
*/
/**
* Meta box class.
*/
@dexit
dexit / ocdi_elementor_kit_import.php
Created June 12, 2025 12:38 — forked from arfinmilondev/ocdi_elementor_kit_import.php
Import Elementor kit data in OCDI
/**
* Function to perform setup after importing data.
* This function assigns the front page and the posts page (blog page) based on the imported demo.
* @param array $selected_import The selected import data.
* @link https://www.codeixer.com/addressing-the-issue-of-one-click-demo-import-not-add-elementor-global-options/
*/
function cdx_after_import_setup( $selected_import ) {
// Import Elementor kit data.
$cdx_kit_zip = get_parent_theme_file_path() . '/demo-content/elementor-kit.zip';
@dexit
dexit / functions.php
Created June 12, 2025 12:37 — forked from harisenbon/functions.php
Elementor Empty Dynamic Field Condition
/**
* Load our override of dynamic-tags-condition
*/
add_action( 'elementor/display_conditions/register', function( $conditions_manager ) {
require_once(get_template_directory() . '/inc/elementor/seg-dynamic-tags-condition.php' );
$conditions_manager->register_condition_instance( new \Seg_Dynamic_Tags_Condition() );
} );
@dexit
dexit / elementor-conditions.php
Created June 12, 2025 12:31 — forked from pingram3541/elementor-conditions.php
Elementor Element Display Condition by Post ID
<?php
/**
* Plugin Name: Elementor Conditions for Elements
* Description: A plugin to add custom display conditions
* Plugin URI: https://elementor.com/
* Version: 1.0.0
* Author: Phil Ingram
* Author URI: https://developers.elementor.com/
* Text Domain: elementor-conditions
*

Mudassar Ali

Muridke Town Main Bazar, Lahore, Punjab, 29000

+92 300 4746182 | [email protected]

LinkedIn: linkedin.com/in/mudassar-ali-chouhan | GitHub: github.com/mudassaralichouhan

Date: [Insert Date]

@dexit
dexit / About-Laravel-Twilio-Webhook-Callback.php
Created June 12, 2025 10:22 — forked from ccc-developer/About-Laravel-Twilio-Webhook-Callback.php
Templates for handling a Twilio Webhook for a Status Callback using Laravel (including Event & Listener)
Hi. I'm new to Laravel & PHP, so thanks for joining me on this journey.
My application CareNote - https://carenote.app allows a user to send a Twilio SMS.
Twilio can post a SMS message status callback/webhook.
Laravel makes it straight-forward to handle this incoming Webhook.
Workflow:
• Route to Incoming Twilio Callback
• Add 'api/twilio/incoming/callback' to the VerifyCsrfToken exclude array