Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Stop images from becoming wrapped in <p> tags
- function filter_ptags_on_images($content){
- return preg_replace('/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(\/a>)?\s*<\/p>/iU', '\1\2\3', $content);
- }
- add_filter('the_content', 'filter_ptags_on_images');
- // Remove WooCommerce if not necessary on page
- function remove_unnecessary_woocommerce() {
- if ( !is_woocommerce() ) wp_deregister_script( 'comment-reply' );
- }
- // Adjust markup on all WooCommerce pages
- remove_action( 'woocommerce_before_main_content', 'woocommerce_output_content_wrapper', 10);
- remove_action( 'woocommerce_after_main_content', 'woocommerce_output_content_wrapper_end', 10);
- add_action('woocommerce_before_main_content', 'sanglorians_before_content', 10);
- add_action('woocommerce_after_main_content', 'sanglorians_after_content', 10);
- // Remove mfunc breaking sidebar crap - this is only needed if you're cacheing the sidebar
- function woocommerce_prevent_sidebar_cache( $sidebar ) {
- echo '';
- }
- // Fix the layout etc
- function sanglorians_before_content() {
- ?>
- <!-- #content Starts -->
- <div id="content" class="clearfix">
- <!-- Header -->
- <header class="header">
- <?php get_template_part( 'navigation' ); ?>
- </header>
- <div class="title"><div class="container clearfix"><h2 class="full">Shop</h2></div></div>
- <div class="container clearfix">
- <div class="two_thirds">
- <?php
- }
- function sanglorians_after_content() {
- ?></div>
- <?php
- }
- // Override image sizes for frontpage slider */
- add_image_size( 'slideshow_full', 1024, 768, true );
- add_image_size( 'slideshow_custom_thumb', 130, 130, true );
- // Removed Google Maps from Subspace functions.php file
- // Currently broken
- function deregister_scripts() {
- wp_deregister_script( 'google-maps' );
- wp_deregister_script( 'jquery-masonry' );
- if ( !is_singular() ) wp_deregister_script( 'comment-reply' );
- }
- add_action('init', 'deregister_scripts');
- // Add optimized async Google Analytics to footer
- // mathiasbynens.be/notes/async-analytics-snippet
- function add_google_analytics() {
- echo '<script>var _gaq = [["_setAccount", "UA-15504121-11"], ["_trackPageview"]]; (function(d, t) {var g = d.createElement(t),s = d.getElementsByTagName(t)[0]; g.src = "//www.google-analytics.com/ga.js"; s.parentNode.insertBefore(g, s);}(document, "script")); </script>';
- }
- add_action('wp_footer', 'add_google_analytics');
- // Disable WooCommerce styles
- //define('WOOCOMMERCE_USE_CSS', false);
- // Disable the theme / plugin text editor in Admin
- define('DISALLOW_FILE_EDIT', true);
- // Remove WordPress head junk
- remove_action('wp_head', 'wp_generator');
- remove_action('wp_head', 'rsd_link');
- remove_action('wp_head', 'wlwmanifest_link');
- // Temporarily add BugHerd back in
- function add_bugherd() {
- echo "<script type='text/javascript'>(function (d, t) {var bh = d.createElement(t), s = d.getElementsByTagName(t)[0];bh.type = 'text/javascript'; bh.src = '//www.bugherd.com/sidebarv2.js?apikey=1e6094ab-cb08-4f6b-bed7-5bae4301e8a8';s.parentNode.insertBefore(bh, s);})(document, 'script');</script>";
- }
- add_action('wp_footer', 'add_bugherd');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement