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 | |
// usage: $imageSrc = get_the_post_thumbnail_src(get_the_post_thumbnail( $post->ID, 'medium')); | |
function get_the_post_thumbnail_src($img) | |
{ | |
return (preg_match('~\bsrc="([^"]++)"~', $img, $matches)) ? $matches[1] : ''; | |
} | |
?> |
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 | |
function the_product_price($product){ | |
//get the sale price of the product whether it be simple, grouped or variable | |
$sale_price = '<span class="new">'.get_post_meta( get_the_ID(), '_price', true).'</span>'; | |
//get the regular price of the product, but of a simple product | |
$regular_price = get_post_meta( get_the_ID(), '_regular_price', true); | |
//oh, the product is variable to $sale_price is empty? Lets get a variation price |
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 | |
function orderby( $a, $b ) { | |
global $posts; | |
$apos = get_field('niveau_academique', $a->ID); | |
$bpos = get_field('niveau_academique', $b->ID); | |
return ( $apos < $bpos ) ? -1 : 1; | |
} | |
usort( $projets->posts, "orderby" ); |
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
if(!Modernizr.svg) { | |
$('img[src*="svg"]').attr('src', function() { | |
return $(this).attr('src').replace('.svg', '.png'); | |
}); | |
} |
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
function reportError(error, message) { | |
message = message || ''; | |
console.error( | |
'ERROR: ' + message + ' [' + error.toString() + ']\n' + | |
'\nName:\t\t' + (error.name || '-') + | |
'\nMessage:\t' + (error.message || '-') + | |
'\nFile:\t\t\t' + (error.fileName || '-') + | |
'\nSource:\t\t' + ((error.toSource && error.toSource()) || '-') + | |
'\nLine #:\t\t' + (error.lineNumber || '-') + | |
'\nColumn #:\t' + (error.columnNumber || '-') + |
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
var events = require('events'); | |
var emitter = new events.EventEmitter(); | |
function taskStatus(status) { | |
if (status === 'done') { | |
emitter.emit('done'); | |
} else if (status === 'doing') { | |
emitter.emit('doing'); | |
} | |
} |
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
if(navigator.userAgent.indexOf('MSIE')){ | |
window.document.execCommand('print', false, null); | |
}else{ | |
window.print(); | |
} |
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
@mixin font-face($family, $filename, $weight, $style) | |
@font-face | |
font-family: $family | |
src: url('../fonts/#{$filename}.eot') | |
src: url('../fonts/#{$filename}.eot?#iefix') format("embedded-opentype"), url('../fonts/#{$filename}.woff') format("woff"), url('../fonts/#{$filename}.ttf') format("truetype"), url('../fonts/#{$filename}.svg##{$filename}') format("svg") | |
font-style: $style | |
font-weight: $weight |
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
$('select').each(function(){ | |
var select = $(this); | |
var html = select[0].outerHTML; | |
var val = $(html).children('option:selected').val(); | |
select.val(val); | |
}); |
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
<!-- Titre du site --> | |
<SharePoint:ProjectProperty Property="Title" runat="server"/> | |
<!-- Breadcrumb --> | |
<asp:SiteMapPath runat="server" id="SiteMapPath1" ParentLevelsDisplayed="1" PathSeparator=" > "> | |
<CurrentNodeStyle CssClass="actual" /> | |
</asp:SiteMapPath> |