Skip to content

Instantly share code, notes, and snippets.

@ivcreative
ivcreative / custom-search-acf-wordpress.php
Created February 1, 2017 15:01 — forked from fiskhandlarn/custom-search-acf-wordpress.php
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request. I updated this original script with better documentation and XSS / SQL injection support.
<?php
/*
##############################
########### Search ###########
##############################
Included are steps to help make this script easier for other to follow
All you have to do is add custom ACF post types into Step 1 and custom taxonomies into Step 10
I also updated this work to include XSS and SQL injection projection
[list_searcheable_acf list all the custom fields we want to include in our search query]
@ivcreative
ivcreative / list_quarters.php
Created May 23, 2017 15:44 — forked from steveirl/list_quarters.php
Get a list of (date) quarters between two given dates. Return array of objects with information about each quarter
<?php
// get month name from number
function month_name($month_number){
return date('F', mktime(0, 0, 0, $month_number, 10));
}
// get get last date of given month (of year)
function month_end_date($year, $month_number){
<?php
//----------------------------------------------------------
// Display Posts Shortcode plugin: add H2 to title
//----------------------------------------------------------
add_filter( 'display_posts_shortcode_output', 'format_dps_title', 10, 9 );
function format_dps_title( $output, $original_atts, $image, $title, $date, $excerpt, $inner_wrapper, $content, $class ) {
// Make Title and H2
$title = ' <h3>'. $title .'</h3>';
@ivcreative
ivcreative / functions.php
Created June 2, 2017 16:26 — forked from billerickson/functions.php
Genesis infinite scroll, supporting column classes, custom settings by page, and both auto + button loading
<?php
/**
*
* Infinite Scroll
*
* @since 1.0.0
*
* @author Lauren Gray
* @author Bill Erickson
@ivcreative
ivcreative / function.php
Created July 7, 2017 12:47 — forked from mattclements/function.php
Wordpress Disable Comments (add to function.php)
<?php
// Add to existing function.php file
// Disable support for comments and trackbacks in post types
function df_disable_comments_post_types_support() {
$post_types = get_post_types();
foreach ($post_types as $post_type) {
if(post_type_supports($post_type, 'comments')) {
remove_post_type_support($post_type, 'comments');
@ivcreative
ivcreative / random_strgenerator.php
Created September 3, 2018 20:05 — forked from irazasyed/random_strgenerator.php
PHP: Generate random string
/**
* Generate and return a random characters string
*
* Useful for generating passwords or hashes.
*
* The default string returned is 8 alphanumeric characters string.
*
* The type of string returned can be changed with the "type" parameter.
* Seven types are - by default - available: basic, alpha, alphanum, num, nozero, unique and md5.
*
@ivcreative
ivcreative / sass-transforms
Created June 23, 2019 21:34 — forked from fieldoffice/sass-transforms
Sass Transform Mixins
// Browser Prefixes
@mixin transform($transforms) {
-webkit-transform: $transforms;
-moz-transform: $transforms;
-ms-transform: $transforms;
transform: $transforms;
}
// Rotate
@mixin rotate ($deg) {
@ivcreative
ivcreative / Featured Image Instructions
Created August 10, 2019 14:35 — forked from spencejs/Featured Image Instructions
Add Instruction Text To Featured Image Box In Wordpress Admin
@ivcreative
ivcreative / index.html
Created October 2, 2019 23:28 — forked from A973C/index.html
A CodePen by A973C. Horizontal Portfolio Layout with CSS3 Animations and jQuery - Demo for my blog post: http://blog.sarasoueidan.com/horizontal-portfolio-layout
<header>
<a href="http://blog.sarasoueidan.com/horizontal-portfolio-layout">Read Tutorial</a>
</header>
<div class="demo-wrapper">
<!-- <h1>Horizontal Portfolio Layout With CSS3 Animations and jQuery</h1> -->
<ul class="portfolio-items">
<li class="item">
@ivcreative
ivcreative / bookmark.js
Created February 18, 2020 15:56 — forked from oilvier/bookmark.js
Javascript to add a bookmark - Cross Browser
/**
*
* Add to bookmark
* Several tests are necessary in order for this "simple" action to work in most of the browsers
*
*/
// First, we define the element where the "Add to bookmark" action will trigger
var triggerBookmark = $(".js-bookmark"); // It must be an `a` tag