Skip to content

Instantly share code, notes, and snippets.

View shesgottadevelopit's full-sized avatar

shesgottadevelopit shesgottadevelopit

View GitHub Profile
@3200creative
3200creative / functions.php
Created March 11, 2015 01:39
Section With Wrap Shortcode
//* Page Section with field for unique class.
function contentSection( $atts, $content = null ) {
$content = preg_replace('#^<\/p>|<p>$#', '', $content);
$a = shortcode_atts( array(
'class' => 'Add Classes Here',
), $atts );
return '<div class="full-block '."{$a['class']}".' "><div class="wrap">' . do_shortcode($content) . '</div></div>';
}
@studiopress
studiopress / allowed-tags.php
Last active June 26, 2020 22:21
Genesis comments.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Remove comment form allowed tags
add_filter( 'comment_form_defaults', 'sp_remove_comment_form_allowed_tags' );
function sp_remove_comment_form_allowed_tags( $defaults ) {
$defaults['comment_notes_after'] = '';
return $defaults;
@clarklab
clarklab / block-helpers.php
Last active August 3, 2021 15:58
Wordpress check if block is used first
<?php
/**
* Block helpers
* add special classes when certain blocks appear, put this in your functions.php file or include it somewhere
*/
// add block classes in body and post class
function blocks_body_class( $classes ) {
global $post;
@atelierbram
atelierbram / set-active-class-in-nunjucks.md
Last active February 26, 2022 05:37
Set Active Class on Nav-Menu-Item in Nunjucks

In html/about/index.html:

{% extends "layouts/layout.njk" %}

{% set base_path = "../../" %}
{% set page_title = "about" %} 

In data.json:

@justinph
justinph / validate_gravatar.php
Created March 19, 2013 16:49
In wordpress, a better way to check if an author has a gravatar or not. Sometimes you might want to check to see if a gravatar exists and not display any image if there isn't one. Uses the wordpress HTTP and caching apis. A better version of this: http://codex.wordpress.org/Using_Gravatars#Checking_for_the_Existence_of_a_Gravatar
/**
* Utility function to check if a gravatar exists for a given email or id
* @param int|string|object $id_or_email A user ID, email address, or comment object
* @return bool if the gravatar exists or not
*/
function validate_gravatar($id_or_email) {
//id or email code borrowed from wp-includes/pluggable.php
$email = '';
@alexdevero
alexdevero / markdown.reg
Last active January 3, 2024 08:48
Add markdown as an item to “New” context menu in Windows 10 (https://superuser.com/questions/638755/add-item-to-new-context-menu-in-windows-8#640486).
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.md]
@="markdown"
[HKEY_CLASSES_ROOT\.md\ShellNew]
"NullFile"=""
[HKEY_CLASSES_ROOT\markdown]
@="Blank Markdown file"
@don1138
don1138 / font-stacks.css
Last active January 30, 2024 09:03
CSS Modern Font Stacks
/* Modern Font Stacks */
/* System */
font-family: system, -apple-system, ".SFNSText-Regular", "San Francisco", "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
/* System (Bootstrap 5.2.0) */
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
/* Times New Roman-based serif */
font-family: Cambria, "Hoefler Text", Utopia, "Liberation Serif", "Nimbus Roman No9 L Regular", Times, "Times New Roman", serif;
@daraul
daraul / decodeHtmlspecialChars.js
Last active February 11, 2024 01:18
Decode PHP's htmlspecialchars encoding with Javascript
return function(text) {
var map = {
'&amp;': '&',
'&#038;': "&",
'&lt;': '<',
'&gt;': '>',
'&quot;': '"',
'&#039;': "'",
'&#8217;': "’",
'&#8216;': "‘",
@rxaviers
rxaviers / gist:7360908
Last active March 29, 2024 09:13
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: