Skip to content

Instantly share code, notes, and snippets.

View wpspeak's full-sized avatar

WPSpeak wpspeak

View GitHub Profile
@wpspeak
wpspeak / functions.php
Created July 10, 2013 19:53
Stop autolinks in comments
<?php
// Stop autolinks in comments
remove_filter('comment_text', 'make_clickable', 9);
@wpspeak
wpspeak / functions.php
Created July 10, 2013 19:54
Remove URL field from Comment Section
<?php
//Remove URL field from Comment Section
function remove_comment_url_fields($fields) {
if(isset($fields['url']))
{
unset($fields['url']);
}
return $fields;
@wpspeak
wpspeak / functions.php
Created July 15, 2013 04:39
Create a Portfolio Post Type
<?php
// Create a Portfolio Post Type
add_action( 'init', 'register_cpt_portfolio' );
function register_cpt_portfolio() {
$labels = array(
'name' => _x( 'Portfolio', 'portfolio' ),
@wpspeak
wpspeak / functions.php
Last active April 16, 2019 14:19
Create a simple Portfolio Custom Post Type
<?php
// Create portfolio custom post type
add_action( 'init', 'register_cpt_portfolio' );
function register_cpt_portfolio() {
register_post_type( 'portfolio',
array(
'labels' => array(
@wpspeak
wpspeak / style.css
Created July 15, 2013 23:19
Add Column Classes
/* Column Classes
------------------------------------------------------------ */
.five-sixths,
.four-fifths,
.four-sixths,
.one-fifth,
.one-fourth,
.one-half,
.one-sixth,
@wpspeak
wpspeak / gist:6004403
Created July 15, 2013 23:24
Example of using column classes
// Two Columns
<div class="one-half first">This is an example of a WordPress post, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many posts as you like in order to share with your readers what exactly is on your mind.</div>
<div class="one-half">This is an example of a WordPress post, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many posts as you like in order to share with your readers what exactly is on your mind.</div>
// Three Columns
<div class="one-third first">This is an example of a WordPress post, you could edit this to put information about yourself or your site so readers know where you are coming from. You can create as many posts as you like in order to share with your readers what exactly is on your mind.</div>
<div class="one-third">This is an example of a WordPress post, you could edit this to put information about yourself or y
@wpspeak
wpspeak / functions.php
Created July 15, 2013 23:28
Modify the size of the Gravatar in the author box
<?php
// Modify the size of the Gravatar in the author box
add_filter( 'genesis_author_box_gravatar_size', 'afn_author_box_gravatar_size' );
function afn_author_box_gravatar_size($size) {
return '80';
}
@wpspeak
wpspeak / functions.php
Last active December 19, 2015 19:09
Change Gravatar Image Size in Comment Section
<?php
// Change Gravatar Image Size in Comment Section
function afn_comment_list_args( $args ) {
return array( 'type' => 'comment', 'avatar_size' => 80, 'callback' => 'genesis_comment_callback' );
}
add_filter( 'genesis_comment_list_args', 'afn_comment_list_args' );
@wpspeak
wpspeak / functions.php
Last active December 19, 2015 19:09
Conditionally remove secondary menu
<?php
// Conditionally remove secondary menu
add_action('template_redirect', 'afn_conditional_actions');
function afn_conditional_actions() {
if ( is_page( 10 ) ) {
remove_action('genesis_after_header', 'genesis_do_subnav');
}
@wpspeak
wpspeak / functions.php
Created July 15, 2013 23:42
Add Button for Horizontal Line in TinyMCE Editor
<?php
function afn_more_buttons($buttons) {
$buttons[] = 'hr';
return $buttons;
}
add_filter("mce_buttons", "afn_more_buttons");