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
Just add this to: | |
Preferences > Package Setteings > Settings - User | |
{ | |
"auto_upgrade_last_run": 1331660912, | |
"repository_channels": [ | |
"http://sublime.wbond.net/repositories.json" | |
] | |
} |
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 (jQuery) { | |
// VERTICALLY ALIGN FUNCTION | |
jQuery.fn.vAlign = function() { | |
return this.each(function(i){ | |
var ah = jQuery(this).height(); | |
var ph = jQuery(this).parent().height(); | |
var mh = Math.ceil((ph-ah) / 2); | |
jQuery(this).css('padding-top', mh); | |
}); | |
}; |
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 | |
//Just put it in functions.php | |
/* Number of columns in Woocommerce Loop */ | |
global $woocommerce_loop; | |
$woocommerce_loop['columns'] = 2; |
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 | |
// Just add it to functions.php | |
// Add currency / symbol | |
add_filter( 'woocommerce_currencies', 'add_rand_currency' ); | |
add_filter( 'woocommerce_currency_symbol', 'add_rand_currency_symbol' ); | |
function add_rand_currency( $currencies ) { | |
$currencies['HRK'] = __( 'Hrvatska kuna (Kn)', 'woothemes' ); |
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 | |
$find = array("vlaue1", "value2", "value3"); | |
$replace = array("replacevalue1","replacevalue2","replacevalue3"); | |
str_ireplace($find,$replace,$string); | |
?> |
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 if ( has_post_thumbnail()) { | |
$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full'); | |
echo $large_image_url[0]; | |
} | |
?> |
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 | |
/* For adding custom field to gallery popup */ | |
function ime_autora_field($form_fields, $post) { | |
$form_fields["ime-autora"] = array( | |
"label" => __("Autor"), | |
"input" => "text", | |
"value" => get_post_meta($post->ID, "_ime-autora", true), | |
"helps" => __("Ime autora slike"), |
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 | |
function excerpt($limit) { | |
$excerpt = explode(' ', get_the_excerpt(), $limit); | |
if (count($excerpt)>=$limit) { | |
array_pop($excerpt); | |
$excerpt = implode(" ",$excerpt).'...'; | |
} else { | |
$excerpt = implode(" ",$excerpt); | |
} | |
$excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt); |
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 this to functions.php */ | |
<?php | |
function pj_featured_img_title() { | |
global $post; | |
$pj_thumbnail_id = get_post_thumbnail_id($post->ID); | |
$pj_thumbnail_image = get_posts(array('p' => $pj_thumbnail_id, 'post_type' => 'attachment', 'post_status' => 'any')); | |
if ($pj_thumbnail_image && isset($pj_thumbnail_image[0])) { | |
return $pj_thumbnail_image[0]->post_title; | |
} |
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 /* Using this instead the_category */ | |
function the_category_filter($thelist,$separator=' ') { | |
if(!defined('WP_ADMIN')) { | |
//list the category names to exclude | |
$exclude = array('Featured', 'Show'); | |
$cats = explode($separator,$thelist); | |
$newlist = array(); | |
foreach($cats as $cat) { | |
$catname = trim(strip_tags($cat)); | |
if(!in_array($catname,$exclude)) |