This file contains hidden or 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
nav.js { | |
li ul { | |
display: block; | |
} | |
.menu_button{ | |
display: none; | |
} | |
.top-nav{ | |
display: inline-block; |
This file contains hidden or 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 | |
add_filter( 'nav_menu_css_class', 'add_parent_url_menu_class', 10, 2 ); | |
function add_parent_url_menu_class( $classes = array(), $item = false ) { | |
// Get current URL | |
$current_url = current_url(); | |
// Get homepage URL | |
$homepage_url = trailingslashit( get_bloginfo( 'url' ) ); |
This file contains hidden or 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
// This will make a new function called "get_the_slug()" which will get the page | |
// slug, for example, of the page is ...com/blog/news/story-name-here, then this | |
// will echo 'story-name-here'. I'm using this in WooCommerce for the product | |
// 360 images, because I need to rename each set of images so they become | |
// unique, I needed a way of getting separating them. The only drawback here, is | |
// that you need to know the slug before you make the images, AND if you rename | |
// that page, the images will break. SO. It's something that is experimental, | |
// but if monitored right, shouldn't be a problem! & | |
function get_the_slug( $id=null ){ |
This file contains hidden or 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
/********************* | |
Contact Form 7 Styles - | |
If you want to leave these colours as they are, then do so, | |
otherwise, wap grey and green for your brand colours in your MIXINS file | |
*********************/ | |
$dark: rgb(50,50,50); | |
$green: rgb(0,200,100); | |
div.wpcf7 { | |
margin: 0; |
This file contains hidden or 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
// Remove UPDATE AVAILABLE messages from Wordpress | |
// Not all clients want to be notifified that their | |
// site is out of date straight away. This way, they | |
// are less likely to explore the link themselves | |
// and either A) Update the site perfectly fine | |
// or b) mess the whole site up beyond replair (database) | |
add_action('admin_menu','wphidenag'); | |
function wphidenag() { | |
remove_action( 'admin_notices', 'update_nag', 3 ); |
This file contains hidden or 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
jQuery( function($) { | |
// This element will stick... | |
var $sticky = $( '#stick_me' ); | |
// ...When you pass this point | |
var $trigger = $( '#turn_on_sticky' ); | |
// If the element exists... | |
if ( $sticky.length > 0 ) { | |
// Get the top |
This file contains hidden or 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
jQuery(document).ready(function ($) { | |
$.fn.scrollBottom = function() { | |
return $(document).height() - this.scrollTop() - this.height(); | |
}; | |
jQuery(window).scroll(function ($) { | |
var offset = $('#main').offset(); //<--- Top of the element where the scroll should start | |
var docViewTop = $(window).scrollTop();//<--- Top of the window | |
var docViewBottom = docViewTop + $(window).height(); //<--- Bottom of the window | |
var elemTop = $('#footer').offset().top; // <-- This is the top of the element that we are testing if it has come into view |
This file contains hidden or 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
//This makes all links that start with # scrolling links | |
$('a[href^="#"]').on('click',function (e) { | |
e.preventDefault(); | |
var target = this.hash, | |
$target = $(target); | |
$('html, body').stop().animate({ | |
'scrollTop': $target.offset().top - 100 | |
}, 900, 'swing', function () { | |
window.location.hash = target - 100; | |
}); |
This file contains hidden or 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
// Wordpress 3.6 seems to have messed up the searchform | |
// Credit: http://salferrarello.com/searchform-php-wordpress-3-6-broken/ | |
function search_form_no_filters() { | |
// look for local searchform template | |
$search_form_template = locate_template( 'searchform.php' ); | |
if ( '' !== $search_form_template ) { | |
// searchform.php exists, remove all filters | |
remove_all_filters('get_search_form'); | |
} | |
} |
This file contains hidden or 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
<script> | |
jQuery(document).ready(function($) { | |
$('.shit-<?php the_ID(); ?>').click(function(){ | |
$.get("<?php echo get_permalink( $post->ID ); ?>", function(data){ | |
$('.iframeArea').empty(); | |
$('#product-<?php the_ID(); ?>', data).appendTo('.iframeArea'); | |
}); | |
}); | |
}); | |
</script> |