Skip to content

Instantly share code, notes, and snippets.

View pablocattaneo's full-sized avatar

Pablo Cattaneo pablocattaneo

View GitHub Profile
@pablocattaneo
pablocattaneo / custom_product_page.xml
Created July 2, 2015 17:49
Crear una custom page para un producto. Create a custom view.phtml in template/catalog/product/my_view.phtml Navigate in the admin to Product->Design->Custom Layout Update Add this block:
<reference name="product.info">
<action method="setTemplate"><template>catalog/product/NEW_VIEW.phtml</template></action>
</reference>
@pablocattaneo
pablocattaneo / media_url_magento.php
Last active September 16, 2017 00:16
Devuelve la url de la carpeta media
<img src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>wysiwyg/samsung_s6/header_s6.png" alt="" />
@pablocattaneo
pablocattaneo / idOutsideLoop.php
Last active September 16, 2017 00:16
Returns de current post id outside the loop.
<?php
// Returns de current post id outside the loop.
global $post; echo $post->ID;
?>
@pablocattaneo
pablocattaneo / category_name.php
Created July 11, 2015 15:20
Returns categories names used in the current post
<?php
// returns categories names used in the current post
$term_list = wp_get_post_terms($post->ID, 'category', array("fields" => "names"));
foreach ($term_list as $categoryName) {
echo " <h1>$categoryName</h1>";
}
?>
@pablocattaneo
pablocattaneo / category-slug.php
Created July 14, 2015 01:05
Devuelve el slug de la categoría. Es decir si la url es "http://localhost/ayaingenieria/category/trabajos/" devuelve la palabra trabajos. Se debe usar en el template de category
<?php
if (is_category( )) {
$cat = get_query_var('cat');
$yourcat = get_category ($cat);
echo 'the slug is '. $yourcat->slug;
}
?>
@pablocattaneo
pablocattaneo / subcategoriesOnCategoyTemplate.php
Created July 16, 2015 00:01
Returns a list of subcategories in the current categegory (Use this code in the category template)
<?php
/* Returns a list of subcategories in the current categegory (Use this code in the category template)*/
if ( is_category() ) {
$current_cat = get_query_var('cat'); ?>
<ul>
<?php wp_list_categories('&title_li=&show_count=1&child_of='.$current_cat); ?>
</ul>
<?php } ?>
@pablocattaneo
pablocattaneo / subcategoriesPost.php
Last active September 16, 2017 00:15
Returns subcategories (categories child) from a specific term.
<ul>
<?php
$categoryID = get_category_by_slug( 'blog' ); /*Retrieve category object by category slug*/
$categoryID = $categoryID ->term_id; /*Get the term id*/
$args = array(
'child_of' => $categoryID,
'title_li' => __( '' )
);
wp_list_categories( $args ); /*Display or retrieve the HTML list of categories.*/
?>
@pablocattaneo
pablocattaneo / html5template.html
Created August 1, 2015 15:50
Basic template html
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8">
<title>The HTML5 Herald</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="Pablo Cattaneo">
@pablocattaneo
pablocattaneo / css_grid_bootstrap.css
Last active September 16, 2017 00:15
/* Only bootrasp css grid Bootstrap v3.3.4 not all css boostrap */
/* Only bootrasp css grid Bootstrap v3.3.4 not all css boostrap */
.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%
@pablocattaneo
pablocattaneo / maps.html
Created August 14, 2015 01:19
Google maps responsive
<div class="col-xs-12 col-sm-6 noPadding">
<div class="google-maps">
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3396.510998242563!2d-60.72046160000001!3d-31.6472367!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95b5a9b2da770ee3%3A0x7b08213d6592c6cd!2sGimnasio+Willie+Pep!5e0!3m2!1ses!2sar!4v1439437884500" width="700" height="720" frameborder="0" style="border:0" allowfullscreen></iframe>
</div>
</div>