Skip to content

Instantly share code, notes, and snippets.

@matt-vaden
matt-vaden / PHP-Modify Genesis 2.0 Comment Box
Last active August 29, 2015 13:56
Modifying the Genesis 2.0 Comment Box
/**
* Customize The Comment Form
* @author Matt Vaden
* link http://www.mattsaffiliatejourney.com/
**/
add_filter( 'comment_form_defaults', 'maj_custom_comment_form' );
function maj_custom_comment_form($fields) {
$fields['comment_notes_before'] = '<div class="comment-policy-box">' .
'<p class="comment-policy">' .
'I\'m very glad you have chosen to leave a comment on my humble site. Please keep in mind that all comments are moderated according to my <a href="/comment-policy/" title="Matt\'s Affiliate Journey - Official Commenting Policy">official commenting policy</a>. Please Do NOT use keywords in the name field because they won\'t be linked to anything anyway...just use your real name. Let\'s try to have a personal and meaningful conversation.' .
@matt-vaden
matt-vaden / CSS-Modify Genesis 2.0 Comment Box
Created February 15, 2014 19:24
Modifying the Genesis 2.0 Comment Box
/* Comment Form Stuff */
#respond .comment-policy-box { border:1px solid #ddd; border-radius:6px;-moz-border-radius:6px;-webkit-border-radius:6px;
margin:30px auto 30px auto; padding:10px 10px 0 10px;
}
#respond p.comment-policy {margin:0; padding:3px 3px 10px 3px;}
#respond p.form-submit {margin:10px 0 10px 0;}
#respond .commentauthorinput,
#respond .commentemailinput,
#respond .commenttextinput { font-family: Georgia, serif; font-size: 14px; font-style: italic; color: #949494; }
#respond input[type="submit"] {padding:20px !important;}
@matt-vaden
matt-vaden / gist:bed2aad4c423aa69e8caad6e6a9623ad
Created March 19, 2017 06:34
Example PHP Loop Using Switch and Case
// Load Testimonials script for specific pages
add_action( 'pre_get_posts', 'mv_show_testimonials_script' );
function mv_show_testimonials_script() {
if ( is_page('services') || is_home() || is_front_page() ) {
// Let's set some server vars
if(strpos($_SERVER['REQUEST_URI'], 'staging1') !== false) {
$mv_server = 'stage_one';
} elseif (strpos($_SERVER['REQUEST_URI'], 'staging2') !== false) {
$mv_server = 'stage_two';