Skip to content

Instantly share code, notes, and snippets.

@k33
k33 / custom-rss-wordpress-feed
Created January 26, 2016 10:29
This adds ACF content to the posts content if it is called by the feed.
// This adds ACF content to the posts content if it is called by the feed.
// SRC: https://digwp.com/2012/10/customizing-wordpress-feeds/ AND http://www.paulund.co.uk/add-custom-fields-to-rss-feed
function fields_in_feed( $content ) {
if( is_feed() ) {
$post_id = get_the_ID();
$acf = get_post_meta( $post_id, 'newsletter-posts-specific', true ); //using 'true' here is vital
$output = '';
@k33
k33 / inxed.html
Created July 24, 2015 12:57
Simple cookie notification bar
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Test tube</title>
@k33
k33 / related-posts.php
Last active August 31, 2016 19:13
WordPress related custom posts and posts loop that excludes duplicates
@k33
k33 / related-posts-loop.php
Last active August 29, 2015 14:19
Loop for related posts by category
@k33
k33 / related-posts-loop.php
Last active August 29, 2015 14:19
Related WordPress custom posts and posts loop that excludes duplicates
@k33
k33 / menu-flyout.js
Last active August 29, 2015 14:06
A flyout menu for Bread & Butter (https://github.com/multiple-states/bread-butter)
<!-- Move to your custom.js file -->
// Open and close the flyout menu
$(".m-menu-open a, .m-menu-close a").click(function(){
$(".page-holder").toggleClass("open", 500, "easeInOutQuart");
});
// When a link is clicked close the flyout menu before navigating to the new page
.first-nav {
display: none;
}
@media (min-width: @break-1) {
/* First level navigation */
.l-first-nav-strip {
position: fixed;
left: 0;
.first-nav {
display: none;
}
@media (min-width: @break-1) {
.first-nav {
display: block;
.make-sm-column( 12 );
}
var map;
function initialize() {
// You need to set your latitude and longitude here
var myLatlng = new google.maps.LatLng(51.497951, -0.144491);
var isDraggable = $(document).width() > 480 ? true : false; // If document is wider than 480px, isDraggable = true, else isDraggable = false SRC - https://coderwall.com/p/pgm8xa
var mapOptions = {
zoom: 16,
@k33
k33 / holding-page-head.js
Last active August 29, 2015 14:06
Holding Page Head for Bread & Butter (https://github.com/multiple-states/bread-butter)
<!-- Move to your custom.js file -->
$(window).on( 'resize', function () {
var viewportHeight = $(window).height();
var headHeight = $(".center-head").height();
var customPadding = (viewportHeight-headHeight)/2;
$(".center-head").css({"padding-top": customPadding });
}).resize();