Skip to content

Instantly share code, notes, and snippets.

@psdes
psdes / gist:70bb66b08bb8afa1f759a334ebe79911
Created January 26, 2023 08:48 — forked from DevinWalker/gist:6fb2783c05b46a2ba251
WordPress: Loop through Categories and Display Posts Within
<?php
/*
* Loop through Categories and Display Posts within
*/
$post_type = 'features';
// Get all the taxonomies for this post type
$taxonomies = get_object_taxonomies( array( 'post_type' => $post_type ) );
foreach( $taxonomies as $taxonomy ) :
@psdes
psdes / functions.php
Created April 17, 2018 12:57 — forked from yoren/functions.php
Parent Post From Another Post Type And A New URL Structure In WordPress
<?php
// Flush rewrite rules after switch theme
function my_rewrite_flush() {
flush_rewrite_rules();
}
add_action( 'after_switch_theme', 'my_rewrite_flush' );
// A little help so we can get the stylesheet from parent theme
// Remove line 10-19 if this is not a child theme
function my_enqueue_styles() {
@psdes
psdes / jsbin.yicufu.css
Last active March 29, 2017 15:19
toggle details// source https://jsbin.com/yicufu
@import url('https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900');
body {font-family: 'Lato', sans-serif; color: #878787; font-weight: 400; overflow-x: hidden;}
.products-list {display: flex;}
.products-list .single-product {padding-bottom: 40px; width: 33%;}
.products-list .single-product .product-content {text-align: center; border: 1px solid #702424; cursor: pointer; position: relative; background: #fff;}
.products-list .single-product .product-content:before,
.products-list .single-product .product-content:after {-webkit-transition: all 0.25s ease-in-out; -moz-transition: all 0.25s ease-in-out; -ms-transition: all 0.25s ease-in-out; -o-transition: all 0.25s ease-in-out; transition: all 0.25s ease-in-out; content: " "; height: 0; width: 0; position: absolute; pointer-events: none; border-width: 6px; margin-left: -6px;}
.products-list .single-product .product-content:before {top: 100%; border-color: rgba(255, 255, 255, 0); border-top-color: #fff;}
.products-list .single-product .product-conte