Skip to content

Instantly share code, notes, and snippets.

View dexit's full-sized avatar
🎯
Focusing

Rihards Mantejs dexit

🎯
Focusing
View GitHub Profile
https://gist.github.com/paulund/6687336
https://wpdatatables.com/crud-system-in-wordpress/
https://www.davidangulo.xyz/how-to-create-crud-operations-plugin-in-wordpress/
https://wpdataaccess.com/2020/04/08/how-to-use-wp-data-access-classes-in-your-own-php-code/
https://paulund.co.uk/crud-queries-for-wordpress-custom-tables
@dexit
dexit / resume.json
Created July 3, 2025 01:42 — forked from bhubbard/resume.json
JSON Resume
{
"basics": {
"name": "Brandon Hubbard",
"label": "WordPress Developer",
"picture": "http://www.gravatar.com/avatar/3596404cbc9ffb7d4f48524e08340d86.png",
"email": "[email protected]",
"phone": "(818) 297-4175",
"website": "https://brandonhubbard.com",
"summary": "Web Developer Manager at Snap One",
"location": {
@dexit
dexit / elementor_script_dequeue_on_funnel_pages.php
Created July 2, 2025 16:21 — forked from xlplugins/elementor_script_dequeue_on_funnel_pages.php
Dequeue elementor scripts on page to avoid error when page is not built with elementor
/**
* Dequeues Elementor scripts and styles for FunnelKit Builder pages
*
* This function prevents loading unnecessary Elementor assets on FunnelKit Builder pages
* that are using canvas or boxed templates but not built with Elementor. This helps
* improve page load performance.
*
* The function checks:
* 1. If Elementor locations exist
* 2. If current post exists and is valid
@dexit
dexit / wc-add-google-structured-data.php
Created July 2, 2025 16:18 — forked from damiencarbery/wc-add-google-structured-data.php
Google Structured Data for WooCommerce: Keep Google happy by providing product info in a form it can easily read https://www.damiencarbery.com/2019/04/google-structured-data-for-woocommerce/
<?php
/*
Plugin Name: Google Structured Data for WooCommerce
Plugin URI: https://www.damiencarbery.com/2019/04/google-structured-data-for-woocommerce/
Description: Add Google Structured Data to WooCommerce products. Asked in: https://www.facebook.com/groups/genesiswp/permalink/2358845040833346/
Author: Damien Carbery
Version: 0.1
*/
add_action( 'woocommerce_before_single_product_summary', 'dcwd_add_wc_structured_data' );
@dexit
dexit / post_excerpt.php
Created July 2, 2025 16:18 — forked from jdevalk/post_excerpt.php
If you have the YouTube code in your post excerpt, this will fix it.
<?php
function fix_content_input( $content, $vid ) {
$post = get_post( $vid['post_id'] );
if ( !empty( $post->post_excerpt ) ) {
$content = "\n" . 'http://youtube.com/v/'. $post->post_excerpt . "\n" . $content;
}
return $content;
}
add_filter( 'wpseo_video_index_content', 'fix_content_input', 10, 2 );
@dexit
dexit / archive-wpseo_locations.php
Created July 2, 2025 16:17 — forked from jdevalk/archive-wpseo_locations.php
Easily create a custom post type archive page such as demoed on [the Yoast Local SEO demo site](http://local.yoastdemo.com/locations/) using this file:
<?php
/** Replace the standard loop with our custom Locations loop */
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'wpseo_locations_archive_loop' );
function wpseo_locations_archive_loop() {
echo '<h1>Locations</h1>';
echo '<div class="entry-content"><p>Your intro text here.</p></div>';
$args = array(
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<script type="text/javascript">
function showGTitle() {
var gText1 = document.getElementById('gtext1pete').value;
var gBold1 = document.getElementById('gbold1pete').value;
var gWords1 = gBold1.split(' ');
for(var gI1=0; gI1<gWords1.length; gI1++) {
@dexit
dexit / How to.md
Created July 2, 2025 16:15 — forked from megclaypool/How to.md
[Insert Custom Post Type Landing Page into Yoast Breadcrumbs] Once you've created a landing page for a custom post type, this is how to insert that landing page into the Yoast breadcrumbs for that post type. Shamelessly adapted from Extending the
  1. Create your custom post type. (That's a whole different ball of wax, but I'll attach an example of a file (which we require_once in functions.php) at the end in case you need an example...)
  2. Create your landing page.
  3. Add the following code to your post type creation page (or anywhere in functions.php or a php document included/required therein, but let's be organized, shall we?):
add_filter( 'wpseo_breadcrumb_links', 'jb_wpseo_breadcrumb_links' );
function jb_wpseo_breadcrumb_links( $links ) {

  // below, add as many post_types as you want custom breadcrumbs for
  if ( is_single() && get_post_type() == 'POST_TYPE_SLUG') {
@dexit
dexit / shortcode-team-member-schema-json.php
Created July 2, 2025 16:15 — forked from Garconis/shortcode-team-member-schema-json.php
WordPress | Shortcode to output JSON-LD structured data for Person schema based on CPT + ACF fields
<?php
/* take some of the fields from the Team Member and use it to make a shortcode that outputs JSON-LD structured data for Person schema */
add_shortcode( 'fs-team-schema', 'fs_team_show_json_schema_shortcode' );
function fs_team_show_json_schema_shortcode() {
// if within an admin page and its not doing Ajax request
if ( is_admin() AND ! wp_doing_ajax() ) {
// then don't return anything since we aren't using it here
return FALSE;
@dexit
dexit / PostTypeTaxonomyMirror.php
Created July 2, 2025 15:23 — forked from benpearson/PostTypeTaxonomyMirror.php
Post type/taxonomy mirror.
<?php
class PostTypeTaxonomyMirror {
private $post_type;
private $taxonomy;