Skip to content

Instantly share code, notes, and snippets.

View paullacey78's full-sized avatar

Paul Lacey paullacey78

View GitHub Profile
@paullacey78
paullacey78 / notices-shortcode.php
Last active December 13, 2017 15:55
Notices shortcode (SMITF)
// Notices Shortcode
// Example usage using a page ID containing the repeater field (could be changed to get the current page ID): [notices id="77"]
function notices_shortcode($atts)
{
// Attributes
$atts = shortcode_atts(array(
'id' => '0',
@paullacey78
paullacey78 / enqueue_simple-line-icons.php
Last active December 8, 2017 08:31
Enqueue Simple Line Icons
/* Enqueue Simple Line Icons */
add_action( 'wp_enqueue_scripts', 'simple_line_icons' );
function simple_line_icons() {
    wp_enqueue_style( 'simple-line-icons', 'https://cdnjs.cloudflare.com/ajax/libs/simple-line-icons/2.4.1/css/simple-line-icons.css' );
}
@paullacey78
paullacey78 / 0_reuse_code.js
Created June 30, 2017 22:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@paullacey78
paullacey78 / gp-bb.css
Last active September 23, 2018 16:51
Force GP into full width, hide page header & title and force layout to no sidebar with Beaver Builder is active on a page.
/* PAGE HEADER */
/* Hide the page header when BB is active on a page */
.hide-page-header .generate-page-header,
.hide-page-header .page-header-image,
.hide-page-header .page-header-image-single {
display:none;
}
/* Unhide the page header when BB is active but we want to use GP custom page header */
@paullacey78
paullacey78 / gp-header-patch.css
Created August 1, 2017 11:55
GeneratePress header fix for logo/nav overlap
/* GeneratePress Header fix for problem break points
Change the 900px value in two places to where you have nav/logo overlap */
@media(min-width:768px) AND (max-width:900px) {
.inside-header {
display: flex;
flex-flow: row wrap;
justify-content: center;
}
#site-navigation {
min-width: 900px;
@paullacey78
paullacey78 / completely-disable-comments.php
Last active August 8, 2017 12:53
Completely disable WordPress comments (front and and backend)
<?php
/* Script found on https://dfactory.eu/wp-how-to-turn-off-disable-comments/ */
// 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');
@paullacey78
paullacey78 / css-gradient.css
Created August 13, 2017 21:05
CSS Text Gradients
.heading_gradient_blue h2 span {
display: inline-block;
color: #254E87; /*non-webkit fallback*/
background: -webkit-linear-gradient(135deg, #2CA44F, #28766D, #254E87);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.heading_gradient_pink h2 span {
display: inline-block;
@paullacey78
paullacey78 / acf-custom-fields.php
Created September 16, 2017 23:43
Enable custom field meta-boxes when ACF is active From https://wpbeaches.com/wordpress-custom-fields-missing-acf-active/
<?php
add_filter('acf/settings/remove_wp_meta_box', '__return_false');
<script type="text/javascript">
// Make jQuery WP friendly
(function ($) {
// Initiate after document loads
$( document ).ready(function() {
// Custom function
jQuery('#content a').click(function(){
jQuery('html, body').animate({