Skip to content

Instantly share code, notes, and snippets.

View pablocattaneo's full-sized avatar

Pablo Cattaneo pablocattaneo

View GitHub Profile
@pablocattaneo
pablocattaneo / category_atribute.php
Created March 21, 2016 19:21
Muestra los valores de los atributos de una categoría Zend_Debug::dump($_category->getData()) //to have a better view of the category's attributes. source: http://magento.stackexchange.com/questions/5344/category-image-getimageurl-is-empty
Zend_Debug::dump($_category->getData()) //to have a better view of the category's attributes.
/* Remove auto p tag in the content */
remove_filter('the_content', 'wpautop');
/* Remove admin bar when login */
add_filter('show_admin_bar', '__return_false');
@pablocattaneo
pablocattaneo / iframe_pablo_cattaneo.html
Last active September 16, 2017 00:05
Iframe element Pablo Cattaneo
<div class="embed-responsive embed-responsive-16by9 wrappperIframe">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/_NBgz7jL6zs" allowfullscreen></iframe>
</div>
@pablocattaneo
pablocattaneo / get categories from a post.php
Created April 14, 2016 01:53
Get categories from a post. Obtiene las categorías de un post
<?php
get_the_category_list()
?>
@pablocattaneo
pablocattaneo / new_gist_file.php
Created April 14, 2016 02:33
Add Css class to previous_posts_link() and next_posts_link() to add pagination. Add to function.php Source: https://css-tricks.com/snippets/wordpress/add-class-to-links-generated-by-next_posts_link-and-previous_posts_link/
<?php
/*Add css class to older post and newer post used in the previous_posts_link() and next_posts_link() functions*/
add_filter('previous_posts_link_attributes', 'older_posts');
add_filter('next_posts_link_attributes', 'newer_posts');
function newer_posts() {
return 'class="newer_posts"';
}
function older_posts() {
return 'class="older_posts"';
@pablocattaneo
pablocattaneo / figure.html
Last active September 16, 2017 00:05
Figure html
<div class="wrapperFigure">
<figure class="figure">
<a href="http://www.pablocattaneo.com/wp-content/uploads/2016/05/opera-mini-proxy-architecture.png">
<img class="alignnone size-full wp-image-109" src="http://www.pablocattaneo.com/wp-content/uploads/2016/05/opera-mini-proxy-architecture.png" alt="Opera Mini’s proxy architecture" width="620" height="150" />
</a>
<figcaption>Opera Mini use a proxy architecture.<span class="figureCopyright">
I don't create this image, it was took from https://dev.opera.com/articles/opera-mini-and-javascript/ Copyright: <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported license.</a>
</span>
</figcaption>
</figure>
@pablocattaneo
pablocattaneo / youtube.html
Last active September 16, 2017 00:05
Youtube custom controllers
<div class="col-xs-12 wrapperVideoWrapper">
<div class="videoWrapper">
<iframe id="video" width="560" height="315" src="https://www.youtube.com/embed/Lrld70lqLn0?enablejsapi=1&amp;rel=0&amp;controls=0&amp;showinfo=0'" frameborder="0" allowfullscreen></iframe>
<div id="pause_button" class="pause_btn"></div>
</div>
<div id="play_button" class="play_btn"></div>
</div> <!-- wrapperVideoWrapper -->
<script type="text/javascript">
//Script fo Play Button
if ("MutationObserver" in window) { // Check if the browser support MutationObserver
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
// Desvinculo el evento mouseover para que lo mensajes de error no se oculten al pasarle el mouse al elemento
console.log(mutation.type);
console.log(mutation.addedNodes);
jQuery('span.wpcf7-not-valid-tip').unbind('mouseover');
jQuery('.wpcf7-form input, .wpcf7-form textarea').unbind('mouseover');
});
});