View gist:11211773
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
find . -type d -print0 | xargs -0 chmod 0775 # For directories | |
find . -type f -print0 | xargs -0 chmod 0664 # For files |
View gist:11212113
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
chown -R web37:client9 * |
View gist:11212154
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 //ADD PAGES MENU | |
$children = get_pages('child_of='.$post->ID); | |
$ancestors = get_post_ancestors($post->ID); | |
//Check if the page has children or ancestors if yes, output pages menu. | |
if(!empty($children) or !empty($ancestors)){ | |
if( is_page() ) { | |
global $post; | |
$parents = get_post_ancestors( $post->ID ); |
View gist:11215147
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 hide_editor_leave_media_button() { | |
global $current_screen; | |
if( $current_screen->post_type == 'ENTER_POST_TYPE_HERE' ) { | |
$css = '<style type="text/css">'; | |
$css .= '#wp-content-editor-container, #post-status-info, .wp-switch-editor { display: none; }'; | |
$css .= '</style>'; | |
echo $css; |
View gist:11212211
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 | |
$session = Mage::getSingleton('customer/session'); | |
if($session->isLoggedIn()) { | |
$customer = $session->getCustomer(); | |
echo $customer->getName(); | |
echo $customer->getFirstname(); | |
} | |
?> |
View gist:11212247
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 //Add this to your local.xml - removes category filter from sideabar. ?> | |
<catalog_category_layered> | |
<block type="catalog/layer_view" name="catalog.leftnav" after="currency" template="catalog/layer/view.phtml"> | |
<action method="unsetChild"><child>category_filter</child></action> | |
</block> | |
</catalog_category_layered> |
View gist:11214990
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_action( 'admin_print_footer_scripts', 'selektirajPodkategorije' ); | |
function selektirajPodkategorije(){ ?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function() { | |
jQuery("#categorychecklist").find("input:checkbox").click(function() { | |
var koji = jQuery(this).parent().parent().parent().attr("id"); | |
if(koji == "categorychecklist") { |
View gist:11215015
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 | |
/*add this to functions.php file in theme */ | |
update_option('siteurl','http://example.com/blog'); | |
update_option('home','http://example.com/blog'); | |
/* After the site is up and running remove those two lines */ |
View gist:11215077
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
jQuery('a[href^="#"]').bind('click.smoothscroll',function (e) { | |
e.preventDefault(); | |
var target = this.hash; | |
$target = jQuery(target); | |
jQuery('html, body').stop().animate({ | |
'scrollTop': $target.offset().top | |
}, 500, 'swing', function () { | |
window.location.hash = target; | |
}); | |
}); |
View gist:11215120
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 | |
/* Remove width/height from featured images */ | |
add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10 ); | |
add_filter( 'image_send_to_editor', 'remove_thumbnail_dimensions', 10 ); | |
function remove_thumbnail_dimensions( $html ) { | |
$html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html ); | |
return $html; | |
} |
OlderNewer