Skip to content

Instantly share code, notes, and snippets.

@ldmedia
ldmedia / gist:969237
Created May 12, 2011 19:18
Código para diferentes singles
<?php
if (in_category(array( '1' ))) {include (TEMPLATEPATH . '/single-recetas.php');
}
if (in_category(array( '4', '5' ))) {include (TEMPLATEPATH . '/single-especiales.php');
}
else { include (TEMPLATEPATH . '/single-original.php');
}
?>
@ldmedia
ldmedia / search limit
Created May 11, 2011 18:31
Limitar tu busqueda a una categoria. WP
<?php if( is_search() ) :
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
query_posts("s=$s&paged=$paged&cat=1,2,3");
endif; ?>
@ldmedia
ldmedia / gist:965137
Created May 10, 2011 18:50
Mandar llamar un menu en WP
<?php wp_nav_menu( array('menu' => 'nombre_del_menu','menu_class' => 'nombre_de_ la_clase' ) ); ?>
if (is_category()) {
$this_category = get_category($cat);
if (get_category_children($this_category->cat_ID) != "") {
echo "<h1>Subcategories</h1>";
echo "<ul>";
wp_list_categories('orderby=id&show_count=0&title_li=
&use_desc_for_title=1&child_of='.$this_category->cat_ID);
echo "</ul>";
}
}
<div id="banner" class="clearfix">
<div class="container_12 clearfix">
<div class="grid_12" id="logotipo">
<h1><a href="<?php bloginfo("home"); ?>"><img src="<?php echo get_bloginfo('template_directory'). "/images/logo.jpg"; ?>" alt="<?php bloginfo('name'); ?>" /></a></h1>
</div>
<div class="grid_4" id="slogan">
<h2><span>Una forma de comprar mejor Sin membresia</span></h2>
</div><!--//Slogan-->
<div class="grid_8 menu-container">
<?php wp_nav_menu( array( 'menu_class' => 'sf-menu clean clearfix', 'theme_location' => 'primary', 'fallback_cb' => 'cudazi_fallback_menu' ) ); ?>