This file contains 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 | |
$id = false; | |
// get current post id if a single (post or page) | |
if(is_single()){ | |
global $post; | |
$id = $post->ID; | |
} | |
// setup basic loop arguments |
This file contains 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 | |
$args = array( | |
'post_type' => 'post', | |
'post_status' => 'publish', | |
'posts_per_page' => '5' | |
'no_found_rows' => true, // turn off pagination information | |
'update_post_meta_cache' => false // don't do anything with post meta cache | |
); |
This file contains 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
$ids = array(); | |
// get current post id if a single (post or page) | |
if(is_single()){ | |
global $post; | |
$ids[] = $post->ID; | |
} | |
// setup basic loop arguments | |
$args = array( | |
'post_type' => 'post', |
This file contains 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 el = document.getElementById('header'); // this is for #header not <header> | |
$(el).('.some-class-used-in-header').each(function(index){ | |
// do something!! to each of the things with this class | |
}); | |
$(el.getElementsByTagName('nav')).on('touchstart click', 'a', function(e){ | |
// do something when an <A> inside a <NAV> inside #header is clicked. | |
e.preventDefault(); // prevents the default click action | |
}); |
This file contains 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
// you can do this | |
$('.class-to-find').each(function(index){ | |
outputValue = $(this).text(); | |
}); | |
// but it will fail badly if there is nothing found by $('class-to-find'). | |
//better to do | |
outputValue = ''; // set a default value | |
if($('.class-to-find').length){ // make sure that there is something to loop | |
$('.class-to-find').each(function(index){ // do the loop |
This file contains 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 gulp = require('gulp'); | |
var concat = require('gulp-concat'); | |
// var minifyCSS = require('gulp-minify-css'); | |
var minify = require("gulp-minify"); | |
var cleanCSS = require('gulp-clean-css'); | |
var rename = require("gulp-rename"); | |
var autoprefixer = require('gulp-autoprefixer'); | |
var sass = require('gulp-sass'); | |
gulp.task('styles', function() { |
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Search for all images on WordPress and download to directory via WGET task list</title> | |
</head> | |
<body> | |
<h1>Search for all images on WordPress and download to directory via WGET task list</h1> | |
<?php | |
This file contains 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
#!/bin/bash | |
for f in $(find . -name '*.jpg' -or -name '*.JPG' -or -name '*.JPEG' -or -name '*.jpeg' -or -name '*.png'); do | |
convert "$f" -resize "1920>" "$f"; | |
This file contains 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
/* ignore netbeans */ | |
/nbproject/private/ | |
/nbproject/ | |
/* ignore WP core and misc for wordpress on */ | |
wp-content/blogs.dir/ | |
wp-content/upgrade/ | |
wp-content/backup-db/ | |
wp-content/advanced-cache.php | |
wp-content/wp-cache-config.php |
This file contains 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 | |
/** | |
* Template Name: Facebook quiz redirect | |
* | |
**/ | |
function check_if_facebook(){ | |
/** | |
* this function checks if the current thing accessing the site is a facebook | |
* bot or not. |
OlderNewer