Created
November 20, 2015 15:06
-
-
Save deepak-rajpal/3795f9372d1ef3dc1ebd to your computer and use it in GitHub Desktop.
WordPress Code snippets shortcodes
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 | |
/* Disable auto paragraph - sometimes issue while content formatting with wordpress/ck-editor */ | |
remove_filter ('the_content', 'wpautop'); | |
// remove_filter ('the_content', 'wptexturize'); | |
?> |
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 | |
/** | |
* 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'); | |
?> |
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 | |
/* Starts: Hide admin bar from front-end */ | |
if(!is_admin()): | |
show_admin_bar(false); | |
endif; | |
/* Ends: Starts: Hide admin bar from front-end */ | |
?> |
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 | |
/* Easy Shortcode to create home url - [site_url] */ | |
add_shortcode('site_url','home_url'); | |
?> |
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 | |
/* 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'; } | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment