Skip to content

Instantly share code, notes, and snippets.

Ryan Stacy RAStacy

View GitHub Profile
View gist:47b48fecc3cfe7777e05
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L]
View gist:2073f1f4d5f6bcc4c8df
// Replaces the excerpt "more" text by a link
function new_excerpt_more($more) {
global $post;
return '<span class="ellipse">...</span><a class="moretag" href="'. get_permalink($post->ID) . '">Read the full article...</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
@RAStacy
RAStacy / cmgform.js
Created Dec 22, 2015
Enqueue cmgform script
View cmgform.js
# Add CMGform script
wp_enqueue_script('cmg-form-js', 'https://dil34hcn6yju7.cloudfront.net/assets/cmgform.js', null, null, false );
@RAStacy
RAStacy / recent posts
Created Dec 18, 2015
Use with YARPP to display recent posts as an alternative to related posts
View recent posts
<?php
if (!is_page(766)) {
related_posts();
} else {
$args = array( 'numberposts' => 4 );
$recent_posts = wp_get_recent_posts($args); ?>
<h3>Recent Posts:</h3>
<div class="recent-posts">
<ul>
<?php foreach( $recent_posts as $recent ){
@RAStacy
RAStacy / WP admin notice
Last active Dec 16, 2015
Adds admin notice to Wordpress dashboard
View WP admin notice
function your_admin_notice(){
echo '<div class="update-nag">
<p style="color:green;"><span style="color:red;">DO NOT UPDATE NEXTGEN WITHOUT FIRST READING THE COMMENTS IN THE NEXTGEN CUSTOM THEME FILE.</span><br /><em>The file is in the themes folder "/themes/arykrau_desktop/nggallery/nextgen_basic_imagebrowser-BAK.php"</em></p>
</div>';
}
add_action('admin_notices', 'your_admin_notice');
@RAStacy
RAStacy / WP version control notice
Last active Dec 16, 2015
Adds version control notice to Wordpress dashboard
View WP version control notice
function your_admin_notice(){
echo '<div class="update-nag">
<p>Version Control is <span style="color:green; font-weight: bold;">ACTIVE</span> for this site.</span></p>
<p>Mobile Site: <span style="color:green; font-weight: bold;">YES: Responsive/Theme Switcher/Third Party</span> / <span style="color:red; font-style:italic;">NO</span></p>
<p>CMG CDN JS Enqueued: <span style="color:green; font-weight: bold;">YES</span> / <span style="color:red; font-style:italic;">NO</span></p>
<p>SCSS / Foundation: <span style="color:green; font-weight: bold;">YES</span> / <span style="color:red; font-style:italic;">NO</span></p>
<p>Shared Hosting: with <span style="color:green; font-weight: bold;">miamibreastlift.com</span></p>
</div>';
}
add_action('admin_notices', 'your_admin_notice');
You can’t perform that action at this time.