Skip to content

Instantly share code, notes, and snippets.

View girlie's full-sized avatar

Shelley Denise girlie

  • GirlieWorks, LLC
View GitHub Profile
@joshuadavidnelson
joshuadavidnelson / basic-dropdown-usage.php
Last active February 27, 2023 13:44
Filter wp_dropdown_categories by post type.
<?php
/**
* Using wp_dropdown_categories with the post type filter applied.
*
* @link https://joshuadnelson.com/category-taxonomy-dropdown-filtered-by-post-type/
*/
// Taxonomy dropdown arguments
$args = array(
'taxonomy' => 'department',
@carasmo
carasmo / for-functions.php
Last active July 2, 2016 19:43
Custom genesis_sitemap_output using the previously created custom get_posts() function to exclude posts or show only a specific category.
<?php
// don't include
/** ====================================================================================
* SITE MAP : archive page filter for genesis_sitemap_output();
* using christina_get_posts_for_sitemap();
==================================================================================== **/
function christina_sitemap($sitemap_post_list) {
@paaljoachim
paaljoachim / genesis-featured-image.php
Last active April 16, 2022 14:52
Featured image for Genesis themes. 1. Sets the featured image. 2. If no featured image get image from category. 3. If no category image then get the first post image. 4. If no post image or category image then sets a fallback image.
add_filter( 'rocket_cache_reject_ua', 'wprocket_remove_fb_ua' );
function wprocket_remove_fb_ua( $ua ) {
if ( in_array( 'facebookexternalhit', $ua ) ) {
$ua = array_flip( $ua );
unset( $ua[ 'facebookexternalhit' ] );
$ua = array_flip( $ua );
}
return $ua;
}
function wp_rocket_activate_inline_js_minify( $html_options ) {
$html_options['jsMinifier'] = 'rocket_minify_inline_js';
return $html_options;
}
add_filter( 'rocket_minify_html_options', 'wp_rocket_activate_inline_js_minify' );
function wp_rocket_deactivate_inline_css_minify( $html_options ) {
unset( $html_options['cssMinifier'] );
return $html_options;
}
anonymous
anonymous / gist:7c1592d763baeb89035e02f7bf1fa41a
Created September 5, 2017 00:01
fix wprocket-slash.php
<?php
defined( 'ABSPATH' ) or die( 'Cheatin\' uh?' );
/*
Plugin Name: Enforce Trailing Slash on URLs
Author: Jonathan (WP Rocket Team)
Author URI: http://wp-rocket.me
*/
add_filter( 'before_rocket_htaccess_rules', '__force_trailing_slash' );
function __force_trailing_slash( $marker ) {
@lanecwheeler
lanecwheeler / slack-css
Last active January 23, 2019 17:52
Custom css to edit colors on Slack desktop client
/*
Copyright 2017 Bryan Keller (https://github.com/widget-)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@blcarson
blcarson / slack-4-lato.css
Created July 23, 2019 00:33
Fork of @caiceA's dark Slack v4 theme with default fonts and minor CSS fixes
@import url('https://fonts.googleapis.com/css?family=Lato:400,700,900&display=swap');
body {
font-family: 'Lato', sans-serif !important;
text-rendering: optimizeLegibility !important;
word-spacing: -1px;
-webkit-font-smoothing: auto;
}
.CodeMirror-cursor {
border-left-color: rgba(255,255,255,1) !important;
}