Skip to content

Instantly share code, notes, and snippets.

@mbootsman
mbootsman / custom-cpt-permalink-rewrite.php
Last active Feb 27, 2020
Custom post type permalink structure with hyphen instead of slash
View custom-cpt-permalink-rewrite.php
View preselect_facets_and_hide.php
<?php
/* Facetwp preselect */
add_filter( 'facetwp_preload_url_vars', 'nstrm_filter_facets' );
function nstrm_filter_facets( $url_vars ) {
// get post uri
$uri = FWP()->helper->get_uri();
// get post id
$post_id = nostromo_get_post_id_by_post_name( $uri );
@mbootsman
mbootsman / full-width-review-table-gravityforms.css
Created Dec 21, 2018
Full width review table for left aligned labels in Gravity Forms
View full-width-review-table-gravityforms.css
body .gform_wrapper ul.gform_fields:not(.top_label):last-child > li.gfield_html_formatted:last-child {
margin-left: 0!important;
width:100%;
}
@mbootsman
mbootsman / unsplash-random.sh
Last active Oct 19, 2019
[Ubuntu] Download random unsplash photo and set as background with logo overlay
View unsplash-random.sh
#/bin/bash
# get image
# adjust 3840x2160 to your screen resolution
wget -O /home/xxxxx/Pictures/wallpaper.jpg https://source.unsplash.com/3840x2160
# add logo
convert /home/xxxxx/Pictures/wallpaper.jpg -page +100+50 /home/xxxxx/Pictures/logo.png -flatten /home/xxxxxx/Pictures/wallpaper-logo.jpg
# set wallpaper
You can’t perform that action at this time.