Skip to content

Instantly share code, notes, and snippets.

@topleague
topleague / comment-time-date.php
Created Jun 28, 2017
Remove Comment Time & Link Inside the Date Field in Genesis
View comment-time-date.php
// Remove Comment Time & Link Inside the Date Field in Genesis (h/t: http://www.jowaltham.com/customising-comment-date-genesis/)
add_filter( 'genesis_show_comment_date', 'topleague_remove_comment_time_and_link' );
function topleague_remove_comment_time_and_link( $comment_date ) {
printf( '<p %s>', genesis_attr( 'comment-meta' ) );
printf( '<time %s>', genesis_attr( 'comment-time' ) );
echo esc_html( get_comment_date() );
echo '</time></p>';
// Return false so that the parent function doesn't also output the comment date and time
View google-adsense-sample-code.js
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:block; text-align:center;"
data-ad-format="fluid"
data-ad-layout="in-article"
data-ad-client="ca-pub-0123456789101112"
data-ad-slot="9876543210"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
@topleague
topleague / page_sitemap.php
Created Aug 17, 2017
Create a Sitemap in Genesis
View page_sitemap.php
<?php
/**
* Genesis Framework.
*
* WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances.
* Please do all modifications in the form of a child theme.
*
* @package Genesis\Templates
* @author StudioPress
* @license GPL-2.0+
@topleague
topleague / feather-icons-css.txt
Created Sep 13, 2020
Customize Feather Icons
View feather-icons-css.txt
.feather {
width: 60px;
height: 60px;
fill: transparent;
stroke: #333333;
stroke-width: .65px;
}
@topleague
topleague / add-the-icon.txt
Created Sep 13, 2020
Add the Feather Icons in Genesis
View add-the-icon.txt
<i data-feather="circle"></i>
@topleague
topleague / feather-icons-cdn.txt
Created Sep 13, 2020
Load Feather Icons Scripts from a CDN Provider
View feather-icons-cdn.txt
<script src="https://unpkg.com/feather-icons"></script>
<script>
feather.replace()
</script>
@topleague
topleague / search-form-under-entry-title-genesis.txt
Created Sep 5, 2020
Create a Search Form under Entry Title in Genesis
View search-form-under-entry-title-genesis.txt
//* STEP #1: ADD EXCERPT SUPPORT TO PAGES
add_post_type_support( 'page', 'excerpt' );
//* Output Excerpt on Pages
add_action( 'genesis_meta', 'lwp_page_description_meta' );
//* STEP #2: REPLACE DEFAULT ENTRY HEADER WITH EXCERPT
function lwp_page_description_meta() {
//* If it's a singular page, apply page description
@topleague
topleague / insert-html-line-awesome.txt
Created Feb 21, 2020
Insert the HTML Code (Line Awesome)
View insert-html-line-awesome.txt
<i class="fa fa-check fa-3x"></i>
<i class="fa fa-check fa-6x"></i>
<i class="fa fa-angle-double-down fa-8x"></i>
<i class="fa fa-angle-double-down fa-10x"></i>
@topleague
topleague / enqueue-line-awesome-script-genesis.txt
Created Feb 21, 2020
Enqueue Line Awesome Scripts in Genesis
View enqueue-line-awesome-script-genesis.txt
wp_enqueue_style( 'line-awesome', '//maxst.icons8.com/vue-static/landings/line-awesome/font-awesome-line-awesome/css/all.min.css' );
@topleague
topleague / custom-search-results.php
Last active Dec 3, 2019
Custom Search Results in Genesis Sample
View custom-search-results.php
<?php
/**
* Source: https://sridharkatakam.com/custom-search-template-in-genesis-showing-results-grouped-by-post-types/
*/
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'sk_do_search_loop' );
/**
* Outputs a custom loop.