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
// Add to functions.php | |
// Pagination for paged posts, Page 1, Page 2, Page 3, with Next and Previous Links, No plugin | |
function html5wp_pagination() | |
{ | |
global $wp_query; | |
$big = 999999999; | |
echo paginate_links(array( | |
'base' => str_replace($big, '%#%', get_pagenum_link($big)), | |
'format' => '?paged=%#%', | |
'current' => max(1, get_query_var('paged')), |
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
if ($_SERVER['HTTP_HOST'] == 'localhost:8888') { | |
define('DB_NAME', 'stefvork_database'); | |
define('DB_USER', 'root'); | |
define('DB_PASSWORD', 'root'); | |
define('DB_HOST', 'localhost'); | |
} else { | |
define('DB_NAME', 'baardbaard_domein'); | |
define('DB_USER', 'baardbaard_user'); | |
define('DB_PASSWORD', 'password'); | |
define('DB_HOST', 'localhost'); |
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 | |
// Source: http://brandonsummers.name/blog/2012/02/10/using-bitbucket-for-automated-deployments/ | |
date_default_timezone_set('Europe/Amsterdam'); | |
class Deploy { | |
/** | |
* A callback function to call after the deploy has finished. |
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
.hide-text { | |
text-indent: 100%; | |
white-space: nowrap; | |
overflow: hidden; | |
} |
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
if ( isset($_GET['debug']) && $_GET['debug'] == 'debug') | |
define('WP_DEBUG', true); |
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
function get_responsive_image($id, $src, $alt = "") { | |
$large = wp_get_attachment_image_src( $id, 'large' ); | |
$medium = wp_get_attachment_image_src( $id, 'medium' ); | |
$small = wp_get_attachment_image_src( $id, 'thumbnail' ); | |
$output = '<div class="img-responsive">'; | |
$output.= ' <div data-picture data-alt="' . $alt . '">'; | |
$output.= ' <div data-src="' . $small[0] . '"></div>'; | |
$output.= ' <div data-src="' . $medium[0] . '" data-media="(min-width: 786px)"></div>'; | |
$output.= ' <div data-src="' . $large[0] . '" data-media="(min-width: 920px)"></div>'; |
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
@mixin at2x($image_name, $w: auto, $h: auto, $extention: '.png') { | |
background-image: image-url($image_name + $extention); | |
$x2img : $image_name + '@2x' + $extention; | |
@media screen and (-webkit-min-device-pixel-ratio : 1.5) { | |
background-image: image-url($x2img); | |
background-size: $w $h; | |
} | |
} |
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 everything in the root except the "wp-content" directory. | |
/* | |
!.gitignore | |
!wp-content/ | |
# Ignore everything in the "wp-content" directory, except the "plugins" | |
# and "themes" directories. | |
wp-content/* | |
!wp-content/plugins/ | |
!wp-content/themes/ |
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
<ifModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml text/css application/xhtml+xml text/css text/javascript application/javascript application/x-javascript | |
</ifModule> |
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
# Apache configuration file | |
# httpd.apache.org/docs/2.2/mod/quickreference.html | |
# Note .htaccess files are an overhead, this logic should be in your Apache config if possible | |
# httpd.apache.org/docs/2.2/howto/htaccess.html | |
# Techniques in here adapted from all over, including: | |
# Kroc Camen: camendesign.com/.htaccess | |
# perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/ | |
# Sample .htaccess file of CMS MODx: modxcms.com |
OlderNewer