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
function dr_email_login_authenticate( $user, $username, $password ) { | |
if ( is_a( $user, 'WP_User' ) ) | |
return $user; | |
if ( !empty( $username ) ) { | |
$username = str_replace( '&', '&', stripslashes( $username ) ); | |
$user = get_user_by( 'email', $username ); | |
if ( isset( $user, $user->user_login, $user->user_status ) && 0 == (int) $user->user_status ) | |
$username = $user->user_login; | |
} |
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(have_posts()) : ?><?php while(have_posts()) : the_post(); ?> | |
<h2><?php the_title(); ?></h2> | |
<?php the_content(); ?> | |
<?php endwhile; endif; ?> |
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
function exclude_category($query) { | |
if ( $query->is_home() ) { | |
$query->set('cat', '-xx'); | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts', 'exclude_category'); | |
Or add below line before start loop have_posts() ) : while ( have_posts()============= |
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 | |
function jeba_more_from_cat( $title = "More From This Category:" ) { | |
global $post; | |
// We should get the first category of the post | |
$categories = get_the_category( $post->ID ); | |
$first_cat = $categories[0]->cat_ID; | |
// Let's start the $output by displaying the title and opening the <ul> | |
$output = '<div id="more-from-cat"><h3>' . $title . '</h3>'; | |
// The arguments of the post list! | |
$args = array( |
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
function custom_login_title() { | |
return 'Your desired text'; | |
} | |
add_filter('login_headertitle', 'custom_login_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
function wps_login_error() { | |
remove_action('login_head', 'wp_shake_js', 12); | |
} | |
add_action('login_head', 'wps_login_error'); |
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
function new_excerpt_more( $more ) | |
{ | |
return ' Load More'; | |
} | |
function custom_excerpt_length( $length ) | |
{ | |
return 500; | |
} | |
add_filter( 'excerpt_length', 'custom_excerpt_length', 500); | |
add_filter('excerpt_more', 'new_excerpt_more'); |
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
// Custom login | |
function custom_login() { | |
$files = '<link rel="stylesheet" href="'.get_bloginfo('template_directory').'/css/login.css" />'; | |
echo $files; | |
} | |
add_action('login_head', 'custom_login'); | |
Or======= | |
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
add_filter( 'excerpt_more', 'excerpt_more_example' ); | |
function excerpt_more_example( $text ) { | |
global $post; | |
return '... <a class="read-more-link" href="' . get_permalink( $post->ID ) . '">Read more</a>'; | |
} |