Skip to content

Instantly share code, notes, and snippets.

View babelpuntocl's full-sized avatar
🤖

babel.cl babelpuntocl

🤖
View GitHub Profile
echo wp_strip_all_tags( get_the_content() );
@babelpuntocl
babelpuntocl / Listar nombre y descripcion categoria custom post type
Last active January 22, 2018 17:10
Listar nombre y descripcion categoria custom post type
<?php $args = array('type' => 'rentals', 'taxonomy' => 'rental-categories');
$categories = get_categories($args);
foreach($categories as $category) {
echo'
<div class="fg12 rentals">
<h2> '. $category->name . '</h2>
<div class="info">
<p>'. $category->description . '</p>
<a class="button" href="#">
<h4><?php $terms = get_terms("sectors"); $count = count($terms); if ( $count > 0 ){ foreach ( $terms as $term ) { echo $term->name; } } ?> Sector</h4>
<?php query_posts( array( 'post_type' => 'NNN') ); if (have_posts()) : while (have_posts()) : the_post(); ?>
...
<?php endwhile; endif; wp_reset_query(); ?>
.videoWrapper {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
}
.videoWrapper iframe {
position: absolute;
top: 0;
left: 0;
<?php $recent = new WP_Query("page_id=nºpage"); while($recent->have_posts()) : $recent->the_post();?>
// bla bla bla
<?php endwhile;?>
<?php wp_reset_query(); ?>
<?php
global $post;
$args = array( 'taxonomy' => 'product_cat',);
$terms = wp_get_post_terms($post->ID,'product_cat', $args);
$count = count($terms);
if ($count > 0) {
foreach ($terms as $term) {
echo '<div style="direction:rtl;">';
// functions.php
class F5_TOP_BAR_WALKER extends Walker_Nav_Menu
{
function display_element( $element, &$children_elements, $max_depth, $depth=0, $args, &$output )
{
$element->has_children = !empty( $children_elements[$element->ID] );
if(!empty($element->classes)){
$element->classes[] = ( $element->current || $element->current_item_ancestor ) ? 'active' : '';