This file contains hidden or 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
function diww_facebook_image() { | |
echo '<meta property="fb:admins" content="ADMIN_ID" />'; | |
echo '<meta property="og:title" content="' . get_the_title() . '" />'; | |
echo '<meta property="og:site_name" content="' . get_bloginfo('name') . '" />'; | |
global $post; | |
if ( is_singular() ) { // only if a single post or page | |
echo '<meta property="og:type" content="article" />'; | |
echo '<meta property="og:url" content="' . get_permalink() . '" />'; | |
if (has_post_thumbnail( $post->ID )) { // use featured image if there is one | |
$feat_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' ); |
This file contains hidden or 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
function change_default_title( $title ){ | |
$screen = get_current_screen(); | |
if ( 'POST_TYPE' == $screen->post_type ) { | |
$title = 'Enter Invoice Title'; | |
} | |
return $title; | |
} | |
add_filter( 'enter_title_here', 'change_default_title' ); |
This file contains hidden or 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
function login_with_email_address($username) { | |
$user = get_user_by('email',$username); | |
if(!empty($user->user_login)) | |
$username = $user->user_login; | |
return $username; | |
} | |
add_action('wp_authenticate','login_with_email_address'); | |
function change_username_wps_text($text){ | |
if(in_array($GLOBALS['pagenow'], array('wp-login.php'))){ | |
if ($text == 'Username'){$text = 'Username / Email';} |
This file contains hidden or 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 or unset URL in comment | |
add_filter('comment_form_default_fields', 'unset_url_field'); | |
function unset_url_field($fields){ | |
if(isset($fields['url'])) | |
unset($fields['url']); | |
return $fields; | |
} |
This file contains hidden or 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
//Force Pages to SSL | |
function wps_force_ssl( $force_ssl, $post_id = 0, $url = '' ) { | |
if ( $post_id == 25 ) { | |
return true | |
} | |
return $force_ssl; | |
} | |
add_filter('force_ssl' , 'wps_force_ssl', 10, 3); | |
This file contains hidden or 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 Builder 3.0 Support | |
add_theme_support( 'builder-3.0' ); | |
// Making all module outer wrappers full width | |
function it_set_full_width_container( $width ) { | |
remove_filter( 'builder_get_container_width', 'it_set_full_width_container' ); | |
return ''; |
This file contains hidden or 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 get_search_form(); ?> |
This file contains hidden or 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
$custom_morelink = "Continue Reading the Full Article"; | |
function change_more_link($more_link, $more_link_text) { | |
return str_replace($more_link_text, $custom_morelink, $more_link); | |
} | |
add_filter('the_content_more_link', 'change_more_link', 10, 2); |
This file contains hidden or 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
//set post title length | |
function maxTitleLength($title) { | |
global $post; | |
$title = $post->post_title; | |
if (str_word_count($title) >= 10) | |
wp_die( __('Error: your post title is over the maximum word count.')); | |
} | |
add_action('publish_post','maxTitleLength'); |