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 / shortcode_image_tag.php
Created July 25, 2025 10:11 — forked from finalwebsites/shortcode_image_tag.php
Add the shortcode option to dynamic tags for background images in Elementor
<?php
// place the snippet inside the functions.php file from your WordPress child theme
use Elementor\Controls_Manager;
add_action( 'elementor/dynamic_tags/register_tags', function( $dynamic_tags ) {
class Custom_Image_Tag extends Elementor\Core\DynamicTags\Data_Tag {
public function get_name() {
return 'shortcode-image';
}
@ksprashu
ksprashu / SYSTEM.md
Created July 24, 2025 04:22
Personal SYSTEM.md override for hardcoded instructions

This document, SYSTEM.md, defines the external rules and constraints of the Gemini agent. It outlines the environment, available tools, and the fundamental operational mandates that govern my behavior at the system level. This is the rulebook.

You are an interactive CLI agent specializing in software engineering tasks. Your primary goal is to help users safely and efficiently, adhering strictly to the following instructions and utilizing your available tools.

Core Mandates

  • Model Constraint: My core reasoning engine is pinned to the highest-quality, generally available model family, which is currently Gemini 2.5. All my reasoning, planning, and generation tasks must use this model family to ensure consistency and quality. I am forbidden from using older model families (e.g., Gemini 1.5) unless explicitly instructed for a temporary, specific purpose. The adoption of a new, superior model family (e.g., Gemini 3.0) must be a deliberate, user-approved update to this directive.
  • **Conventions:
@ksprashu
ksprashu / GEMINI.md
Last active November 24, 2025 19:48
Personal GEMINI.md as on 29-07-2025

Gemini Agent: Core Directives and Operating Protocols

@dexit
dexit / SEO.md
Created July 2, 2025 15:01 — forked from denzildoyle/SEO.md
I short list of SEO tips and tricks I have learned over time

SEO

In this list, I will be typically be talking SEO as it relates to Google because Google will likely account for the vast majority of your inbound search traffic. Additionally, if you rank highly on Google, you will probably do well on other search engines anyway. Just like in football if you could play in the Major league you would most likely kill it in the minor league I would begin by explaining why SEO is important talk a little bit about what SEO is about and talk about how those concepts relate to the world wide web. Then talk about some of the things you could do to optimize your site from top to bottom of a typical webpage.

Why it's important

  • When you want to hide something on google put it on the second page. #SEO @searchdecoder
  • Winner takes almost everything
  • More than 80 percent of shoppers research big purchases online first
  • Opertunity for business
  • 88% Of Consumers Trust Online Reviews As Much As Personal Recommendations
  • 72% Of Consumers Say That Positive Reviews Make Them T
<?php
/**
* Render the schema graph for the acf/gb-faq block.
*
* @param array $graph Schema data for the current page.
* @param WP_Block_Parser_Block $block The block data array.
* @param Meta_Tags_Context $context A value object with context variables.
*
* @return array Our Schema graph.
*/
@dexit
dexit / wp-inspector-enhanced.php
Created July 2, 2025 13:10 — forked from brandonjp/wp-inspector-enhanced.php
WordPress Post Inspector [SnipSnip.pro] - displays post metadata, SEO information, and WordPress data in a floating panel with admin controls and configuration options. - https://snipsnip.pro/s/884
<?php
/**
* Title: Enhanced WordPress Post Inspector with Admin Controls [SnipSnip.pro]
* Description: A comprehensive debugging tool that displays post metadata, SEO information, and WordPress data in a floating panel. Features configurable position, admin settings, light/dark themes, enhanced data extraction, and security controls for developers.
* Version: 3.2.1
* Author: Brandon Pfeiffer
* Last Updated: 2025-07-01
* Blog URL: https://snipsnip.pro/s/884
* Gist URL: https://gist.github.com/brandonjp/025592669bce65f7031a00f8b04d5c97
* Code Snippets Cloud: https://codesnippets.cloud/snippet/brandonjp/WordPress-Post-541
@dexit
dexit / replacevar-script.js
Created July 2, 2025 12:42 — forked from erikyo/replacevar-script.js
Adds to Yoast an additional replacement variable both in frontend and snippet preview (backend)
/* inspired from https://github.com/Yoast/wpseo-woocommerce/blob/trunk/js/src/yoastseo-woo-replacevars.js */
/* global jQuery, YoastSEO, app, globals YoastACFAnalysisConfig */
var pluginName = "additionalVariablePlugin";
var ReplaceVar = window.YoastReplaceVarPlugin && window.YoastReplaceVarPlugin.ReplaceVar;
var placeholders = {};
var modifiableFields = [
"content",
"title",
<?php
$featured_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'img_post' );
// img_post is name of my thumbnail size ( I've added my own in functions.php )
$focuskw = get_post_meta(get_the_ID(), ‘_yoast_wpseo_focuskw’, true);
// It's focus keyword that you enter in Yoast Metabox in post edit page, it's really important
$primary_cat = get_post_meta(get_the_ID(), ‘_yoast_wpseo_primary_category’, true);
// Primary Category is important, for permalink format and meta keywords
if($primary_cat == NULL && $primary_cat == ''){
@dexit
dexit / wordpress.php
Created July 1, 2025 18:00 — forked from amorkovin/wordpress.php
Разное по WordPress
<?php
//Получить ID автора поста
$post_author_id = get_post_field( 'post_author', $post_id );
//Или
$post_author_id = get_the_author_ID();
//Получение ID автора поста на странице архива автора
if ( is_author() ) {
$author_id = get_query_var( 'author' );
}
@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() );
} );