Skip to content

Instantly share code, notes, and snippets.

@iamsaief
iamsaief / _Responsive Typography | Fluid Font Size, SASS Mixin, Utility Class.md
Last active June 8, 2025 16:55
Responsive Typography | Fluid Font Size, SASS Mixin, Utility Class

Responsive Typography | Fluid Font Size, SASS Mixin, Utility Class

This Sass mixin allows you to create fluid font sizes that will scale responsively based on the viewport width. It takes two arguments:

  • Min font size: The minimum font size in pixels.
  • Max font size: The maximum font size in pixels.
  • (optional) Min viewport width: The minimum viewport width in pixels.
  • (optional) Max viewport width: The maximum viewport width in pixels.

The mixin will then calculate a fluid font size that falls within that range, based on the current viewport width.

@BinaryMoon
BinaryMoon / get-post-gallery.php
Last active May 1, 2021 13:03
Make WordPress function Get_Post_Gallery work for Gutenberg powered sites.
<?php
/**
* Plugin Name: Get Post Gallery Polyfill
* Plugin URI: https://prothemedesign.com
* Description: Make Get_Post_Gallery work for Gutenberg powered sites.
* Author: Ben Gillbanks
* Version: 1.0
* Author URI: https://prothemedesign.com
*
* @package ptd
@llgruff
llgruff / How to detect if a WordPress plugin is active.php
Last active October 25, 2022 09:29
A function you can use to check if plugin is active/loaded for your plugins/themes
<?php
/**
* Detect if a WordPress plugin is active
* A function you can use to check if plugin is active/loaded for your plugins/themes
* @link //gist.github.com/llgruff/c5666bfeded5de69b1aa424aa80cc14f
*/
// When coding plugins that rely on another one, like Private Content for bbPress or Visual Attributes for WooCommerce, you need to make if the WordPress Plugin is active to initialize your plugin routines or display a notice saying that the required plugin must be activated. In this tutorial we’ll see how to detect whether a certain plugin is active in a couple of ways.
## 1. Check whether a certain class or function or constant exists
@sirtimid
sirtimid / auto-polylang-media.php
Last active April 10, 2021 17:16
Translate media automatically when using Polylang in Wordpress
<?php
if ( !function_exists( 'translate_all_media' ) ) {
function translate_all_media() {
global $polylang;
if(!$polylang) return;
// find languages
$langs = array();