This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Originally found here: https://www.kvcodes.com/2015/12/delete-all-post-meta-except-thumbnail-in-wordpress-posts/ | |
//Copy from line 3 to the end and paste into your theme's function file. | |
function kv_delete_all_meta_except_featuredimg(){ | |
$args = array( 'posts_per_page' => -1, 'post_status' => 'any', 'post_type' => array('attachment', 'page','post')); | |
$articles= get_posts( $args ); | |
foreach($articles as $article){ | |
if($article->post_type == 'attachment'){ | |
$myvals = get_post_meta($article->ID); | |
foreach($myvals as $key=>$val) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?PHP | |
// Allow Editors to manage Widgets and Menus | |
function sp_editor_capabilities() { | |
$editor = get_role( 'editor' ); | |
if (!$editor->has_cap( 'edit_theme_options' ) ) { | |
$editor->add_cap( 'edit_theme_options' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This adds logo to header, adds page title if using special page template, and... | |
// | |
// Here goes the logo in Header | |
// | |
add_action( 'genesis_header', 'ursidae_site_image', 5 ); | |
function ursidae_site_image() { | |
if ( is_page_template( array( 'page_special.php', 'page_other_special.php' ) ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
January 2018 | |
2: Science Fiction Day #ScienceFictionDay | |
4: National Trivia Day #NationalTriviaDay | |
5: National Bird Day #NationalBirdDay | |
8: Clean Off Your Desk Day #CleanOffYourDeskDay | |
11: Human Trafficking Awareness Day #HumanTraffickingDay | |
13: National Sticker Day #NationalStickerDay | |
15: Martin Luther King, Jr. Day #MLKDay | |
National Hat Day #NationalHatDay | |
18: Get to Know Your Customers Day (third Thursday of every quarter) #GetToKnowYourCustomersDay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Andrew Norcross - Date Modified Display - http://andrewnorcross.com/tutorials/modified-date-display/ */ | |
// Post Columns | |
add_action ( 'manage_posts_custom_column', 'rkv_post_columns_data', 10, 2 ); | |
add_filter ( 'manage_edit-post_columns', 'rkv_post_columns_display' ); | |
function rkv_post_columns_data( $column, $post_id ) { | |
switch ( $column ) { | |
case 'modified': | |
$m_orig = get_post_field( 'post_modified', $post_id, 'raw' ); | |
$m_stamp = strtotime( $m_orig ); | |
$modified = date('n/j/y @ g:i a', $m_stamp ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Remove the link from each post titles in a specific category | |
add_filter( 'genesis_post_title_output', 'uca_post_title_output', 15 ); | |
function uca_post_title_output( $title ) { | |
if ( in_category( 'uncategorized' ) || in_category( 'category-2' )) { | |
$title = sprintf( '<h2 class="entry-title">%s</h2> ', apply_filters( 'genesis_post_title_text', get_the_title() ) ); | |
return $title; | |
} | |
return $title; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('the_content', 'remove_fusion_shortcodes', 20, 1); | |
function remove_fusion_shortcodes( $content ) { | |
$content = preg_replace('/\[\/?fusion.*?\]/', '', $content); | |
return $content; | |
} | |
?> | |
**Tested with WP All Import and Export** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Make the date picker start 2 weeks from current date. | |
Find this in your form: | |
<input name="input_26" id="input_2_26" type="text" value="" class="datepicker medium mdy datepicker_with_icon hasDatepicker"> | |
The id above equals the formID and fieldID below. | |
<script type="text/javascript"> | |
gform.addFilter( 'gform_datepicker_options_pre_init', function( optionsObj, formId, fieldId ) { | |
if ( formId == 2 && fieldId == 26 ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: 'Merriweather', serif; | |
font-weight: 400; | |
font-style: normal; | |
} | |
.et_pb_gutters1 .et_pb_column .et_pb_module { | |
border: 1px solid #eee; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( ! defined( 'ABSPATH' ) ) die('-1'); | |
/* | |
* WDG-customized version of the Events Calendar Pro mini calendar widget. | |
* Changes are noted inline. | |
* Replacing class name: TribeEventsMiniCalendarWidget | |
*/ | |
class MultisiteTribeEventsMiniCalendarWidget extends WP_Widget { | |
function __construct() { |
NewerOlder