Skip to content

Instantly share code, notes, and snippets.

View jdelia's full-sized avatar

Jackie D'Elia jdelia

View GitHub Profile
/* normal flexbox */
.flexbox .flex-container {
display: -webkit-flex;
display: -moz-flex;
display: -ms-flex;
display: flex;
}
.flexbox .flex-container.vertical {
display: -webkit-flex;
display: -moz-flex;
@wpscholar
wpscholar / functions.php
Last active March 1, 2021 13:26
Enqueueing IE conditional stylesheets in WordPress the right way
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
/**
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE.
* IE10 and up does not support conditional comments in standards mode.
*
* @uses wp_style_add_data() WordPress function to add the conditional data.
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/
@glueckpress
glueckpress / paginate-parent-children.php
Last active September 3, 2021 19:42
[WordPress] Pagination for a parent page and their child pages.
<?php
/**
* Pagination for a parent page and their child pages.
* Use as gp130428_link_pages() in your template file.
* Optionally limit to a particular parent page by passing its ID (i.e. 123) to the function: gp130428_link_pages( 123 )
*
*/
function gp130428_paginate_parent_children( $parent = null ) {
global $post;
@studiopress
studiopress / functions.php
Last active March 22, 2017 05:41
Sticky menu.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Enqueue sticky menu script
add_action( 'wp_enqueue_scripts', 'sp_enqueue_script' );
function sp_enqueue_script() {
wp_enqueue_script( 'sample-sticky-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/sticky-menu.js', array( 'jquery' ), '1.0.0' );
}
//* Reposition the secondary navigation menu
@alexkalh
alexkalh / php-convert-color-code-from-hex-to-rgba
Created January 7, 2015 03:23
php-convert-color-code-from-hex-to-rgba
<?php
function ak_convert_hex2rgba($color, $opacity = false) {
$default = 'rgb(0,0,0)';
if (empty($color))
return $default;
if ($color[0] == '#')
$color = substr($color, 1);
@neilgee
neilgee / slick-init-multiple-page-genesis.php
Last active April 25, 2019 23:50
Slick Carousel Enqueued and USed with ACF
<?php // <~ keep me in
add_action('genesis_entry_content','themeprefix_team_slider' );
//Fields
//team_portfolio = Gallery Field
function themeprefix_team_slider() {
$images = get_field('team_portfolio');//add your correct filed name
if( $images ): ?>
<div class="team-items">
@nciske
nciske / custom-simple-sidebar.php
Last active November 29, 2016 22:29
Add a custom simple sidebar to a page, CPT archive, singular post, etc.
<?php
// Hooks to remove default sidebar and add our custom one
// Place me in functions.php or above genesis(); on a page template (in which case, no conditional is needed)
add_action('get_header','example_change_genesis_sidebar');
function example_change_genesis_sidebar() {
// change the conditional to determine where the swap occurs
// https://codex.wordpress.org/Conditional_Tags
@neilgee
neilgee / archive-title-removal.php
Created March 2, 2016 02:39
Remove Archive Title & Description from all the Genesis Archive Pages
<?php //<~ Remove me
//Removes Title and Description on CPT Archive
remove_action( 'genesis_before_loop', 'genesis_do_cpt_archive_title_description' );
//Removes Title and Description on Blog Archive
remove_action( 'genesis_before_loop', 'genesis_do_posts_page_heading' );
//Removes Title and Description on Date Archive
remove_action( 'genesis_before_loop', 'genesis_do_date_archive_title' );
//Removes Title and Description on Archive, Taxonomy, Category, Tag
remove_action( 'genesis_before_loop', 'genesis_do_taxonomy_title_description', 15 );
@Auke1810
Auke1810 / wpa-clean-header.php
Last active May 9, 2024 14:14
create a clean wordpress header and remove unnecessary clutter.
<?php
/*
Plugin Name: wordpress assist clean header
Plugin URI: http://www.wordpressassist.nl/
Description: Remove shortlink hook
Version: 1.0
Author: AukeJomm
Author URI: http://www.aukejongbloed.nl
*/
@thierrypigot
thierrypigot / script.js
Created October 20, 2017 06:01
Smooth scroll Javascript
jQuery(document).ready(function ($) {
'use strict';
// Smooth scroll
// https://css-tricks.com/snippets/jquery/smooth-scrolling/
// Select all links with hashes
$('a[href*="#"]')
// Remove links that don't actually link to anything
.not('[href="#"]')
.not('[href="#0"]')