Skip to content

Instantly share code, notes, and snippets.

@gnikolopoulos
gnikolopoulos / functions.php
Created August 27, 2015 10:47
Add Defer and Async Attributes to Render Blocking Javascript in WordPress
<?php
function defer_js_async($tag){
// scripts to defer.
$scripts_to_defer = array('script-name1.js', 'script-name2.js', 'script-name3.js');
// scripts to async.
$scripts_to_async = array('script-name1.js', 'script-name2.js', 'script-name3.js');
foreach($scripts_to_defer as $defer_script){
@neilgee
neilgee / archive-title-removal.php
Created March 2, 2016 02:39
Remove Archive Title & Description from all the Genesis Archive Pages
<?php //<~ Remove me
//Removes Title and Description on CPT Archive
remove_action( 'genesis_before_loop', 'genesis_do_cpt_archive_title_description' );
//Removes Title and Description on Blog Archive
remove_action( 'genesis_before_loop', 'genesis_do_posts_page_heading' );
//Removes Title and Description on Date Archive
remove_action( 'genesis_before_loop', 'genesis_do_date_archive_title' );
//Removes Title and Description on Archive, Taxonomy, Category, Tag
remove_action( 'genesis_before_loop', 'genesis_do_taxonomy_title_description', 15 );
@carasmo
carasmo / readmore.php
Created March 31, 2016 14:25
Read More outside the paragraph
<?php
//don't include this
/** ====================================================================================
* Break more link outside the paragraph in the loop on all archives (home, archives, search, etc)
==================================================================================== **/
function yourprefix_excerpt_more_link() {
@billerickson
billerickson / page_featured_blog.php
Last active July 21, 2018 05:58 — forked from ChristopherNeetz/page_featured_blog.php
Genesis page template with full blog post and additional posts with excerpts
@carasmo
carasmo / read-more.php
Last active August 2, 2016 19:32
Check for the default <!--more--> and change it but leave custom <!--more Custom Text--> alone
<?php
// don't use
/** ======================================================================================
*
* Read More the_content_more_link
* Check for the default <!--more--> and change it
* but leave custom <!--more Custom Text--> alone
*
======================================================================================= */
@carasmo
carasmo / paginate-comments-in-genesis.php
Created July 14, 2016 19:43
Paginate Comments/Discussion in Genesis Child theme.
<?php
// don't use above. Put this in your functions.php file.
/** ======================================================================================
*
* Paginate Comments
*
======================================================================================= */
function yourprefix_paginate_comments() {
@patric-boehner
patric-boehner / a-shortcode-ui.php
Last active August 30, 2016 19:26
A Shortcake UI example adding an editable button (cta) into body content in wordpress.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//**********************************************
// Setup CTA Button Widget
//**********************************************
/*
* We have three attributes:
* - Button Text
@patric-boehner
patric-boehner / functions.php
Last active September 23, 2022 02:55
Removing in-post settings for the Genesis Framework, including seo, layout and scripts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
/*
* You can find the refrance for supports that Genesis adds
* in the core files lib > admin > inpost-metaboxes.php
*/
//* Remove Action
@ControlledChaos
ControlledChaos / README.md
Last active January 9, 2019 15:47
Turns the WordPress Menus and Widgets links in the admin menu into top-level menu items.

Move Menus & Widgets

WordPress Snippet