Skip to content

Instantly share code, notes, and snippets.

@topleague
topleague / number-columns-genesis-footer-widgets.css
Created October 30, 2017 06:00
CSS for Columns in Genesis Footer Widgets
@topleague
topleague / overlay-entry-title-excerpts-featured-image.php
Last active November 9, 2017 09:51
How to Overlay Entry Title and Excerpts on Featured Image in Genesis
//* Add Excerpt support to Pages in Genesis
add_post_type_support( 'page', 'excerpt' );
//* Display Page Title and Page Excerpt (as Subtitle) after Header
add_action( 'genesis_header', 'susanta_remove_page_title');
function susanta_remove_page_title () {
if ( is_singular( 'post' && 'page' ) && has_excerpt() && !is_front_page()) {
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_after_header', 'susanta_after_header_content' );
@topleague
topleague / styling-overlay-entry-title-featured-image.css
Created November 9, 2017 06:35
Styling Overlay Entry Title and Excerpts in Featured Image
/* Styling for Entry Title and Excerpts */
.post-hero {
background-size: cover;
background-repeat: no-repeat;
padding-top: 4%;
padding-bottom: 8%;
}
.post-hero .page-title {
@topleague
topleague / featured-image-blog-page-genesis.php
Last active December 3, 2019 07:11
How to Display Featured Image and Overlay Entry Title with Excerpts on Blog Page in Genesis
@topleague
topleague / google-adsense-sample-code.js
Created November 21, 2017 07:07
Sample Google AdSense Code
<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 / adsense-sample-code-amp.js
Created November 21, 2017 07:08
AMP Compliant AdSense Code Sample
<amp-ad width=300 height=250
type="adsense"
data-ad-client="ca-pub-0123456789101112"
data-ad-slot="9876543210">
</amp-ad>
@topleague
topleague / redirect-AMP-to-NON-AMP.php
Created November 22, 2017 15:13
Redirect AMP URLs to Non-AMP URLs
# Redirect from AMP to non-AMP path
RewriteEngine On
RewriteCond %{REQUEST_URI} (.+)/amp(.*)$
RewriteRule ^ %1/ [R=301,L]
@topleague
topleague / htacces-old-domain-new.php
Created November 23, 2017 04:55
Code for .htaccess File (Redirecting an Old Domain to a New Domain)
#Use PHP 5.4
# Use PHP54 as default
AddHandler application/x-httpd-php54 .php
<IfModule mod_suphp.c>
suPHP_ConfigPath /opt/php54/lib
</IfModule>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301,NC]
@topleague
topleague / mailchimp-rss-email.css
Created November 25, 2017 13:46
MailChimp Code for RSS to Email
*|RSSITEMS:|*
<h2 class="mc-toc-title"><a href="*|RSSITEM:URL|*" target="_blank">*|RSSITEM:TITLE|*</a></h2>
<em>By *|RSSITEM:AUTHOR|* on *|RSSITEM:DATE|*</em><br />
*|RSSITEM:CONTENT|*<br />
<br />
<a href="*|RSSITEM:URL|*" target="_blank">Read in browser &raquo;</a><br />
<br />
*|END:RSSITEMS|*<br />
<br />
<h3 class="h3">Recent Articles:</h3>
@topleague
topleague / css-premium-fonts-installation.css
Created December 7, 2017 12:04
Example of CSS for Premium Font Installation
/* CSS code in the Downloaded Folder */
@font-face {
font-family: 'Sailec';
src: url('Sailec-Regular.woff2') format('woff2'),
url('Sailec-Regular.woff') format('woff');
font-weight: normal;
font-style: normal;
}