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 | |
//get 10 random products | |
$someProducts = Product::orderBy(DB::raw('RAND()'))->limit(10)->get(); |
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 | |
add_action('init','rewriteRules'); | |
add_filter('post_type_link', 'portfolioPermalinks', 10, 3); | |
function rewriteRules() | |
{ | |
// Register custom rewrite rules for portfolio post type | |
global $wp_rewrite; | |
$wp_rewrite->add_rewrite_tag('%portfolio%', '([^/]+)', 'portfolio='); |
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 getOembedHtml($url,$width,$height) | |
{ | |
require_once( ABSPATH . WPINC . '/class-oembed.php' ); | |
$oembed = _wp_oembed_get_object(); | |
$html = $oembed->get_html($url,array('width' => (int)$width,'height' => (int)$height) ); | |
return $html; |
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 | |
//if you use it in a namespace, you'll need this line | |
//use \DateTime as DateTime; | |
//TODO: needs documentation and testing | |
/** | |
* Takes month and year, returns days of the month, next and prev month etc | |
* its used like $calendar = new CalendarBase(8,2014); |
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
git rm -r --cached . | |
git add --all | |
git commit -am 'git cache cleared' |
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
//source: http://stackoverflow.com/questions/1850232/turkish-case-conversion-in-javascript | |
String.prototype.turkishToUpper = function(){ | |
var string = this; | |
var letters = { "i": "İ", "ş": "Ş", "ğ": "Ğ", "ü": "Ü", "ö": "Ö", "ç": "Ç", "ı": "I" }; | |
string = string.replace(/(([iışğüçö]))+/g, function(letter){ return letters[letter]; }) | |
return string.toUpperCase(); | |
} | |
String.prototype.turkishToLower = function(){ |
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
BootstrapModalControl = { | |
init : function(){ | |
//for necessary binding | |
}, | |
modelBox : function(){ | |
//this could be dynamic if you have more than one modal | |
return $('#admin-modal'); | |
}, |
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
<div class="entry__arrows visible-md visible-lg"> | |
<a class="entry__arrow entry__arrow--prev" href="<?=get_permalink(get_adjacent_post(false,'',false));?>"></a> | |
<a class="entry__arrow entry__arrow--next" href="<?=get_permalink(get_adjacent_post(false,'',true));?>"></a> | |
</div> |
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 wp_bootstrap_pagination( $wp_query = false ) { | |
if($wp_query == false) { | |
global $wp_query; | |
} | |
$big = 999999999; | |
$pages = paginate_links(array( | |
'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), | |
'format' => '?page=%#%', | |
'current' => max(1, get_query_var('paged')), |
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
.htaccess | |
wp-config.php | |
wp-content/uploads/ | |
wp-cli.yml | |
wp-content/blogs.dir/ | |
wp-content/upgrade/ | |
wp-content/backup-db/ | |
wp-content/backupwordpress* | |
wp-content/advanced-cache.php | |
wp-content/wp-cache-config.php |
OlderNewer