How To Load jQuery From Google CDN
WordPress by default load its own jQuery in your theme BUT using the following snippet in your theme’s functions.php file will load the library directly from Google CDN.
1 2 3 4 5 6 7 8 |
function jquery_cdn() { if (!is_admin()) { wp_deregister_script('jquery'); wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js', false, '1.8.3'); wp_enqueue_script('jquery'); } } add_action('init', 'jquery_cdn'); |
Snippet Source/Credit: WP Tips
Adding Paragraph Tags Automatically In Your WordPress Blog
Using the following snippet, you will be able to add paragraph tags automatically in your WordPress blog.
1 2 3 4 |
$my_text = 'Lorem ipsum dolor sit amet consectetur adipiscing elit. Nulla pretium libero eget gravida rutrum.'; echo wpautop( $my_text ); |
Snippet Source/Credit: Daniel Pataki
Changing Author URL Base
The following snippet will let you change author URL base.
1 2 3 4 5 6 |
add_action('init', 'cng_author_base'); function cng_author_base() { global $wp_rewrite; $author_slug = 'profile'; // change slug name $wp_rewrite->author_base = $author_slug; } |
Snippet Source/Credit: Kevin Chard
How To Redirect To A Custom Page After Registration
The following snippet will let you redirect to a custom page once registration got completed. Simply copy the snippet and paste it to your theme’s functions.php file.
1 2 3 4 |
function __my_registration_redirect(){ return home_url( '/my-page' ); } add_filter( 'registration_redirect', '__my_registration_redirect' ); |
Snippet Source/Credit: TheDeadMedic
Changing WordPress Login Logo Title Attribute
Using the following snippet, you will be able to change WordPress login logo title attribute.
1 2 3 4 |
function custom_login_title() { return 'Your desired text'; } add_filter('login_headertitle', 'custom_login_title'); |
Snippet Source/Credit: Dave Clements