How To Disable WordPress wpautop for Shortcodes

Author: , June 15th, 2018

remove_filter( ‘the_content’, ‘wpautop’ ); add_filter( ‘the_content’, ‘smart_autop’ ); function smart_autop($content) { $post = get_post(); if($post->post_type != ‘post’) return $content; // if not a post, leave $content untouched return wpautop($content); }

How To Add a Login/Logout Menu Link in WordPress

Author: , January 19th, 2015

Simple Link 1 2 3 4 5 6 7     $redirect = ( is_home() ) ? false : get_permalink();     if ( is_user_logged_in() ) {         $link = ‘<a href="&#039; . wp_logout_url( $redirect ) . &#039;" title="Log Out" class="broken_link">Log Out</a>’;     } else {         $link […]