home_url()
Useful for a link to the home directory.
<a title='Home' href='<?php echo home_url(); ?>'>Home</a>
Stylesheet Directory
// Remove the shortcode function that is already there | |
remove_shortcode('gallery'); | |
// Add our new one | |
add_shortcode('gallery', 'djave_gallery_shortcode'); | |
// Define the new gallery function | |
function djave_gallery_shortcode($atts) { | |
// Define some variables | |
global $post; | |
$retour; |
// Wraps a string in an html tag quickly | |
// e.g. wrap("hi"); | |
function wrap($text, $tag='p', $echo=true, $class=''){ | |
if($class!=''){ | |
$class = " class='$class'"; | |
} | |
$string = "<$tag$class>$text</$tag>"; | |
if(!$echo){ | |
return $string; | |
} |
// Prints an array or objects in PHP | |
// print($object); | |
function print_a( $a ) { | |
print( '<pre>' ); | |
print_r( $a ); | |
print( '</pre>' ); | |
} |
// EG @include aspectRatio(4,3) | |
@mixin aspectRatio($width,$height){ | |
height:0; | |
padding-bottom:percentage($height/$width); | |
} |
<?php | |
$filename = SITE_ROOT . '/public/layouts/programmatic/twitter.php'; | |
if (file_exists($filename)) { | |
$minutes = 20; | |
// 60 seconds * 20 = 20 minutes | |
$time_to_check = 60 * $minutes; | |
// Current time (time() will tell you the time... in seconds) minus the time the file was modified = how old the file is | |
$time_since_creation = time() - filemtime($filename); | |
if($time_since_creation > $time_to_check){ |
[{"name":"products","color":"Red","position":{"x":100,"y":100},"increment":true,"timestamp":true,"softdelete":false,"column":[{"name":"name","type":"string","length":"210","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c23","order":0}],"relation":[],"seeding":[]}] |
[{"name":"products","color":"Red","position":{"x":100,"y":100},"increment":true,"timestamp":true,"softdelete":false,"column":[{"name":"name","type":"string","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c23","order":0},{"name":"producer_id","type":"integer","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c31","order":1},{"name":"description","type":"text","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c199","order":2}],"relation":[{"extramethods":"","foreignkeys":"","name":"producer","relatedmodel":"producers","relationtype":"belongsTo","usenamespace":""}],"seeding":[]},{"name":"producers","color":"Green", |
[{"name":"products","color":"Red","position":{"x":100,"y":100},"increment":true,"timestamp":true,"softdelete":false,"column":[{"name":"name","type":"string","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c23","order":0},{"name":"producer_id","type":"integer","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c31","order":1},{"name":"description","type":"text","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":false,"hidden":false,"colid":"c199","order":2},{"name":"ingredients","type":"text","length":"","defaultvalue":"","enumvalue":"","ai":false,"pk":false,"nu":false,"ui":false,"in":false,"un":false,"fillable":false,"guarded":false,"visible":f |