WordPress Code snippets shortcodes
<?php
/* Including Evo Slider - Only if front end - So that no JS/CSS including if admin */
if (!is_admin()) { include TEMPLATEPATH . '/custom-files/evo_slider_wp.php'; }
?>
<?php
/* Easy Shortcode to create home url - [site_url] */
add_shortcode('site_url','home_url');
?>
<?php
/* Starts: Hide admin bar from front-end */
if(!is_admin()):
show_admin_bar(false);
endif;
/* Ends: Starts: Hide admin bar from front-end */
?>
<?php
/**
* Disable WordPress Canonical URL or Permalink Auto Redirect -
* When URL of post/page changes, old url automatically gets redirected to new or similar ones.
* Sometimes URL redirects to wrong pages but we need to highlight "Page Not Found" for every wrong URL.
*/
remove_action('template_redirect', 'redirect_canonical');
?>
<?php
/* Disable auto paragraph - sometimes issue while content formatting with wordpress/ck-editor */
remove_filter ('the_content', 'wpautop');
// remove_filter ('the_content', 'wptexturize');
?>