Skip to content

Instantly share code, notes, and snippets.

View portseif's full-sized avatar

Chris Seifert portseif

View GitHub Profile
@portseif
portseif / wp-query-ref.php
Created December 24, 2020 00:13 — forked from luetkemj/wp-query-ref.php
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
//Get the Custom Post Type
// -1 means we get all the posts type.
<?php
$things = get_posts(['post_type' => 'CPT','posts_per_page' => -1]);
//Start with 0 calories
$total = 0;
//Then Loop through all the posts in your CPT
Foreach($LotsofPosts as $singlePost):
//well grab the calories from each post
/*Put this in the header*/
html{visibility: hidden;opacity:0;}
/*Put this in the footer*/
html {
visibility: visible;
opacity: 1;
}
//PHP Custom Code - plugins loaded
if ( function_exists( 'acf_add_options_page' ) ) {
acf_add_options_page();
}
function tct_field($field_name) {
return get_field( $field_name, 'option' );
}
@portseif
portseif / custom-scrollbar.css
Created May 27, 2020 17:03
[Custom CSS Scrollbar] webkit CSS scrollbar #css #scrollbar
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-button {
width: 8px;
height: 5px;
}
::-webkit-scrollbar-track {
background: #eee;
border: thin solid lightgray;
@portseif
portseif / css-media-queries-cheat-sheet.css
Created May 27, 2020 16:45 — forked from bartholomej/css-media-queries-cheat-sheet.css
CSS Media Query Cheat Sheet (with Foundation)
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }
@portseif
portseif / animate-header.js
Last active January 30, 2020 02:42
jQuery Animation
document.addEventListener("DOMContentLoaded", function () {
jQuery(function ($) {
$(document).scroll(function () {
if ($("#header").hasClass("elementor-sticky--effects")) {
// active
console.log("active");
$("#header").animate({
"left": 0,
"width": "100%",
"justify-content": "center"