Skip to content

Instantly share code, notes, and snippets.

@edalis
edalis / feed-short.php
Last active October 17, 2016 07:29 — forked from gregrickaby/feed-short.php
WP: Custom RSS Template
<?php
/**
* Customs RSS feed with related posts.
*
* Place this file in your theme's directory.
*
* @package sometheme
* @subpackage theme
*/
@edalis
edalis / modify-text-before-after-comments-form.php
Last active October 17, 2016 07:33
WP: Modify Text Before & After Comments Form
// From http://wpsites.net/web-design/modify-text-before-after-comment-form/
function wpsites_change_note_after_comment_form($arg) {
$arg['comment_notes_after'] = '<p class="comment-notes">' . __( 'Thanks for leaving an awesome comment!' ) . '</p>';
return $arg;
}
add_filter('comment_form_defaults', 'wpsites_change_note_after_comment_form');
function wpsites_modify_text_before_comment_form($arg) {
$arg['comment_notes_before'] = '<p class="comment-notes">' . __( 'We respect your privacy and will not publish your personal details.' ) . '</p>';
@edalis
edalis / remove-url-field-from-comments-form.php
Last active October 17, 2016 07:35
WP: Remove URL from Comments Form
// http://crunchify.com/wordpress-tips-quick-way-to-remove-url-field-from-comment-form/
function crunchify_disable_comment_url($fields) {
unset($fields['url']);
return $fields;
}
add_filter('comment_form_default_fields','crunchify_disable_comment_url');
@edalis
edalis / removing-wordpress-header.php
Last active October 17, 2016 07:37
WP: Removing Header
// https://scotch.io/quick-tips/removing-wordpress-header-junk
// =========================================================================
// REMOVE JUNK FROM HEAD
// =========================================================================
remove_action('wp_head', 'rsd_link'); // remove really simple discovery link
remove_action('wp_head', 'wp_generator'); // remove wordpress version
remove_action('wp_head', 'feed_links', 2); // remove rss feed links (make sure you add them in yourself if youre using feedblitz or an rss service)
remove_action('wp_head', 'feed_links_extra', 3); // removes all extra rss feed links
@edalis
edalis / loading-parent-styles-for-child-themes.php
Last active October 17, 2016 07:39
WP: Loading Parent Styles for Child Themes
// http://justintadlock.com/archives/2014/11/03/loading-parent-styles-for-child-themes
add_action( 'wp_enqueue_scripts', 'my_enqueue_styles' );
function my_enqueue_styles() {
/* If using a child theme, auto-load the parent theme style. */
if ( is_child_theme() ) {
wp_enqueue_style( 'parent-style', trailingslashit( get_template_directory_uri() ) . 'style.css' );
}
@edalis
edalis / customizing-comment-form.php
Last active October 17, 2016 07:41
WP Genesis: Customizing HTML5 Comment Form
// http://tinyurl.com/p4fddly
//***Customize The Comment Form**/
add_filter( 'comment_form_defaults', 'bourncreative_custom_comment_form' );
function bourncreative_custom_comment_form($fields) {
$fields['comment_notes_before'] = ''; //Removes Email Privacy Notice
$fields['title_reply'] = __( 'Share Your Comments & Feedback:', 'customtheme' ); //Changes The Form Headline
$fields['label_submit'] = __( 'Share My Comment', 'customtheme' ); //Changes The Submit Button Text
$fields['comment_notes_after'] = ''; //Removes Form Allowed Tags Box
return $fields;
}
@edalis
edalis / remove-url-field-comment-form.php
Last active August 16, 2018 14:23
WP Genesis: Remove URL Field Comment Form
add_filter( 'genesis_comment_form_args', 'url_filtered' );
add_filter( 'comment_form_default_fields', 'url_filtered' );
function url_filtered( $fields ) {
if ( isset( $fields['url'] ) )
unset( $fields['url'] );
if ( isset( $fields['fields']['url'] ) )
unset( $fields['fields']['url'] );