Skip to content

Instantly share code, notes, and snippets.

View jpcontrerasv's full-sized avatar
🏠
Working from home

Juan Pablo Contreras Valdés jpcontrerasv

🏠
Working from home
View GitHub Profile
@jpcontrerasv
jpcontrerasv / dropdown-responsive-menu.html
Created March 23, 2015 19:41
Dropdown responsive menu
http://codepen.io/micahgodbolt/pen/czwer
p::first-letter {
font-weight: bold;
color: red;
float: left;
width: 0.7em;
font-size: 400%;
font-family: algerian, courier;
line-height: 80%;
}
<?php bloginfo('name'); ?>&nbsp;<?php if ( is_home() ) { ?><? } else { ?> / <?php
echo empty( $post->post_parent ) ? get_the_title( $post->ID ) : get_the_title( $post->post_parent );
?><? } ?>
@jpcontrerasv
jpcontrerasv / Condicional WPML.php
Created January 15, 2016 16:06
Condicional WPML
<?php if(ICL_LANGUAGE_CODE=='en'){ ?>
<?php } if(ICL_LANGUAGE_CODE=='es'){ ?>
<?php } ?>
$locale='es_ES';
@jpcontrerasv
jpcontrerasv / gravatar
Created May 4, 2016 18:29
Crear Gravatar
http://shibashake.com/wordpress-theme/wordpress-gravatars-use-your-own-default-avatar
@jpcontrerasv
jpcontrerasv / numero incremento.php
Created August 3, 2016 15:07
Número Incremento
<?php
if ( have_posts() ) :
$slideNumber = 1;
while ( have_posts() ) : the_post(); ?>
<div id="slide">
<ul>
<li class="slide-<?php echo $slideNumber++; ?>">
<a href="#">stuff</a></li>
</ul>
</div>
@jpcontrerasv
jpcontrerasv / ACF If Else field.php
Created August 26, 2016 04:46
ACF If Else field
<?php if ( get_field( 'field_name' ) ): ?>
This is displayed when the field_name is TRUE or has a value.
<?php else: // field_name returned false ?>
This is displayed when the field is FALSE, NULL or the field does not exist.
<?php endif; // end of if field_name logic ?>
@jpcontrerasv
jpcontrerasv / else if wordpress.php
Created November 4, 2016 14:53
else if wordpress
<? if ( is_singular('project') ) : ?>
<?php elseif( is_singular('news') ): ?>
<? else : ?>
<?php endif; ?>
@jpcontrerasv
jpcontrerasv / get_the_term_list.php
Created December 13, 2016 04:07
get the term list
<?php $terms = get_terms('expertice', array('hide_empty' => true) );?>
<?php foreach($terms as $term){?>
<li><a href="<?php echo get_term_link( $term );?>">#<?php echo $term->name;?></a></li>
<?php } ?>