Skip to content

Instantly share code, notes, and snippets.

View mdemrs's full-sized avatar

Mdemrs mdemrs

  • Mdemrs
  • Marseille
View GitHub Profile
@mdemrs
mdemrs / fixed-nav.js
Created March 12, 2019 12:58 — forked from pavelbinar/fixed-nav.js
JavaScript: Fixed top nav after certain distance from top
// Fixed nav after certain point
// Show the fixed-strip after reachinch 240px from the top
$(window).scroll(function () {
if ($(this).scrollTop() > 240) {
$('.fixed-strip').css('visibility', 'visible');
} else {
$('.fixed-strip').css('visibility', 'hidden');
}
});
@mdemrs
mdemrs / primary_category.php
Created January 26, 2017 22:21 — forked from jawinn/primary_category.php
Display Primary Category (Yoast's WordPress SEO)
<?php
// SHOW YOAST PRIMARY CATEGORY, OR FIRST CATEGORY
$category = get_the_category();
$useCatLink = true;
// If post has a category assigned.
if ($category){
$category_display = '';
$category_link = '';
if ( class_exists('WPSEO_Primary_Term') )
@mdemrs
mdemrs / Gruntfile.js
Last active August 29, 2015 14:17 — forked from markgoodyear/01-gulpfile.js
grunt and gulp files config
/*!
* Grunt
* $ npm install grunt-contrib-uglify grunt-autoprefixer grunt-contrib-cssmin grunt-contrib-imagemin grunt-contrib-sass grunt-contrib-watch grunt-contrib-concat grunt-contrib-clean grunt-contrib-jshint grunt-notify --save-dev
*/
module.exports = function(grunt) {
grunt.initConfig({
// Sass