Skip to content

Instantly share code, notes, and snippets.

View Zeaksblog's full-sized avatar
🌴
On vacation

Scott Zeaksblog

🌴
On vacation
View GitHub Profile
@Zeaksblog
Zeaksblog / gist:1927664
Created February 27, 2012 22:45
Add note to Wordpress comment form
// Add a note above the comment form
add_action( 'comment_form_top', 'comment_notes' );
function comment_notes() {
?>
<div class="comment_notes"><?php echo "Here is a message I want to show users when they leave a comment."; ?></div>
<style type="text/css">
.comment_notes{
    font-family: Helvetica, Arial, sans-serif;
    font-size:13px;
    font-weight: bold;
@Zeaksblog
Zeaksblog / gist:1927671
Created February 27, 2012 22:46
First post full rest excerpts Wordpress
Change -
<?php the_excerpt(); ?>
<?php
if( is_home() && !is_paged() && ($posts[0] == $post) ) {
echo apply_filters('the_content', $post->post_content);
} else {
the_excerpt();
}
?>
@Zeaksblog
Zeaksblog / gist:1927690
Created February 27, 2012 22:49
Excerpt Control Wordpress
<?php
/* Code that preserves HTML formatting to the automatically generated Excerpt. */
/* Also modifies the default excerpt_length and excerpt_more filters. */
function custom_wp_trim_excerpt($text) {
$raw_excerpt = $text;
if ( '' == $text ) {
$text = get_the_content('');
$text = strip_shortcodes( $text );
@Zeaksblog
Zeaksblog / functions.php
Created November 8, 2012 20:24
Featured image post class
<?php
function appendPostClassHasFeaturedImageClass($classes) {
if(current_theme_supports('post-thumbnails'))
if(has_post_thumbnail())
$classes[] = "has-featured-image";
return $classes;
} add_filter('post_class', "appendPostClassHasFeaturedImageClass");
@Zeaksblog
Zeaksblog / functions.php
Last active December 15, 2015 08:19
Always show WordPress admin bar
<?php
// Show admin bar to all users
add_action( 'show_admin_bar', '__return_true' );
add_action( 'template_redirect', 'admin_bar_login_css' );
function admin_bar_login_css() {
if ( is_user_logged_in() )
return;
@Zeaksblog
Zeaksblog / Skyshard_Golden_lotus_farm_QB.xml
Last active March 10, 2016 20:41
Honorbuddy - Skyshard and Golden lotus Farm 5.4+ Horde. Using Questbot.
<HBProfile>
<!--
This is my first profile. I wanted to farm skyshards but all the other skyshard profiles I found didn't work after the 5.4 changes and I seen a few people looking too so I wanted to share.
This profile will grind the Shao-Tien mobs in Valley of the Four Winds.
Mainly for Skyshards, got mine in 2 nights and a day. Should also get lots of greens, cloth, motes of harmony, BOE blues and even 476 BOE Epics.
It uses a fairly large path, tries to avoid the Sha mobs.
It will fly to the proper area, and fly to venders and back.
It will vender Greys only and mail Whites Blue and Epic. Keeps Skyshards, Motes, Cloth, Lockboxes
<?php
/**
* Include bbPress 'topic' custom post type in WordPress' search results
*/
function ntwb_bbp_topic_cpt_search( $topic_search ) {
$topic_search['exclude_from_search'] = false;
return $topic_search;
}
add_filter( 'bbp_register_topic_post_type', 'ntwb_bbp_topic_cpt_search' );
@Zeaksblog
Zeaksblog / bootstrap-nav.css
Last active October 22, 2015 23:03
Bootstrap menu with dividers
/* add left and right padding and divider */
@media (min-width: 768px) {
.navbar-default ul.nav > li:first-child { padding-right:5px; }
.navbar-default ul.nav > li+li {
border-left: solid 1px #950025;
padding:0 5px;
}
}
@media (min-width: 768px) {
.navbar-collapse {
@Zeaksblog
Zeaksblog / readmore
Created October 26, 2015 05:51
read more temp
function bootville_lite_landing_excerpt_more($more) {
global $post;
return '<div class="view-full-post"><p><a href="'. get_permalink($post->ID) . '"
class="' . get_theme_mod('bootville_lite_widget_more_color' ) . ' '. get_theme_mod('bootville_lite_landing_widget_button_size') . '">View Full Post</a></p></div>';
}
add_filter('excerpt_more', 'bootville_lite_landing_excerpt_more');