Skip to content

Instantly share code, notes, and snippets.

View LeMiira's full-sized avatar
🏠
Working from home

Mira LeMiira

🏠
Working from home
View GitHub Profile
@LeMiira
LeMiira / custom-checkbox-style.scss
Created December 6, 2024 12:35
Custom css style for elementor form checkbox
<style>
.elementor-form-fields-wrapper {
/* Style for normal state */
input[type="checkbox"] {
-webkit-appearance: none; /* Removes default checkbox style */
-moz-appearance: none;
appearance: none;
width: 16px;
@LeMiira
LeMiira / safe-content-wp.php
Created November 29, 2024 14:19
Allow All safe tags for output content in WordPress
<?php // Define allowed HTML tags
$allowed_tags = array(
'a' => array(
'href' => array(),
'title' => array(),
'target' => array(),
'rel' => array(),
),
'abbr' => array(
'title' => array(),
@LeMiira
LeMiira / query.php
Last active July 19, 2024 09:49
elementor query post_in
add_action('elementor/query/readNextQueryx', function ($query) {
// Retrieve the custom field 'what_to_read_next_articles'
$postsID = get_post_meta(get_the_ID(), 'what_to_read_next_articles', true);
// Ensure $postsID is an array and contains only valid, existing post IDs
if (!is_array($postsID)) {
$postsID = explode(',', $postsID);
}
$postsID = array_filter($postsID, 'get_post');
@LeMiira
LeMiira / code.php
Last active February 27, 2024 19:41
Polylang supported custom breadcrumb
<?php
// Add Shortcode
function custom_breadcrumb_shortcode() {
// Get the queried object
$page = get_queried_object();
// Initialize breadcrumb variable
$breadcrumb = '<ul class="breadcrumb">';
@LeMiira
LeMiira / preloader.svg
Created October 6, 2023 11:41
simple svg preloader
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@LeMiira
LeMiira / tempermonkey-free-twitter-verified-badge.js
Created April 24, 2023 09:29
FREE UserScript Twitter Verified Badges for Everyone!
// ==UserScript==
// @name Twitter Verified Icon by Mira
// @version 1
// @description Show a blue verified icon beside each Twitter user's name if they are a verified account.
// @author Mira
// @match *://twitter.com/*
// @grant none
// ==/UserScript==
@LeMiira
LeMiira / taxQueryElementor
Created April 17, 2023 10:01
Tax Query elementor tax_query
<?php
add_action( 'elementor/query/solutionQuery', function( $query ) {
$tremID=get_queried_object_id();
$query->set( 'posts_per_page', -1 );
$query->set( 'post_type', 'solution' );
<?php
require_once($_SERVER['DOCUMENT_ROOT'] . '/wp-load.php');
$args = array(
'numberposts' => 10,
'post_type' => 'ag_location',
'post_status' => 'publish',
'suppress_filters' => true
);
@LeMiira
LeMiira / desc.php
Created January 16, 2023 14:44 — forked from igorbenic/desc.php
How to Programmatically Change Yoast SEO Open Graph Meta | http://www.ibenic.com/programmatically-change-yoast-seo-open-graph-meta
<?php
function change_yoast_seo_og_meta() {
add_filter( 'wpseo_opengraph_desc', 'change_desc' );
}
function change_desc( $desc ) {
// This article is actually a landing page for an eBook
if( is_singular( 123 ) ) {
@LeMiira
LeMiira / yoast_seo_opengraph_change_image_size.php
Created January 16, 2023 10:15 — forked from amboutwe/yoast_seo_opengraph_change_image_size.php
Code snippet to change or remove OpenGraph output in Yoast SEO. There are multiple snippets in this code.
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Change size for Yoast SEO OpenGraph image for all content
* Credit: Yoast Development team
* Last Tested: May 19 2020 using Yoast SEO 14.1 on WordPress 5.4.1
* Accepts WordPress reserved image size names: 'thumb', 'thumbnail', 'medium', 'large', 'post-thumbnail'
* Accepts custom image size names: https://developer.wordpress.org/reference/functions/add_image_size/
*/