Conéctate para seguir esto  
Seguidores 0
wordpressdeprueba

problemas con la plantilla homeland de themeforest

1 mensaje en este tema

Hola estoy trabajando con esta plantilla de homeland bajada de la web por el momento para trabajarla y me encuentro que no se modificar unos valores. Estoy trabajando en la home page que la personalice en el archivo que permite modificarlo "template-page-builder.php" en el cual puse tres columnas donde quiero que me aparezca diferentes contenidos en la 1º solo las propiedades que estan en venta, la 2º que aparezcan solo los alquileres de deptos y en la 3º columna alquileres fijos. Para hacer estas tres columnas, copie parte del codigo del el archivo "custom-functions.php" (se encuentra en include/lib), el cual, este fragmento me arroja un listado de las ultimas propiedades subidas de todos los ESTADOS (categorias), y yo necesito que me muestre solo en la primera columna "venta" en la 2º "alquileres de deptos" y en la 3º "alquileres fijos".
LINK DE LA PLANTILLA http://www.filedropper.com/homeland_1 les dejo un rar con la plantilla completa y a continuacion les muestro el fragmento que copie para hacer las 3 columnas en el archivo "custom-functions.php" (que se encuentra en include/lib):

CODIGO BASE:

/* Featured Properties List */

if ( ! function_exists( 'homeland_featured_list' ) ) :
function homeland_featured_list() {
global $post;

$homeland_album_order = esc_attr( get_option('homeland_album_order') );
$homeland_album_orderby = esc_attr( get_option('homeland_album_orderby') );
$homeland_featured_property_limit = esc_attr( get_option('homeland_featured_property_limit') );
$homeland_featured_property_header = esc_attr( get_option('homeland_featured_property_header') );
$homeland_price_format = esc_attr( get_option('homeland_price_format') );
$homeland_currency = esc_attr( get_option('homeland_property_currency') ); 
$homeland_property_currency_sign = esc_attr( get_option('homeland_property_currency_sign') ); 
$homeland_preferred_size = esc_attr( get_option('homeland_preferred_size') ); 
$homeland_featured_property_header_label = !empty($homeland_featured_property_header) ? $homeland_featured_property_header : esc_html__('Featured Property', 'homeland');
?>
<div class="featured-block">
<h3><span><?php echo esc_html( $homeland_featured_property_header_label ); ?></span></h3>
<?php
$args = array( 
'post_type' => 'homeland_properties', 
'orderby' => $homeland_album_orderby, 
'order' => $homeland_album_order, 
'posts_per_page' => $homeland_featured_property_limit, 
'meta_query' => array( array( 
'key' => 'homeland_featured', 
'value' => 'on', 
'compare' => '==' 
))
);
$wp_query = new WP_Query( $args );

if ($wp_query->have_posts()) : ?>
<div class="grid cs-style-3">
<ul>
<?php
while ($wp_query->have_posts()) : 
$wp_query->the_post(); 
$homeland_price_per = esc_attr(get_post_meta( $post->ID, 'homeland_price_per', true));
$homeland_price = esc_attr(get_post_meta($post->ID, 'homeland_price', true));
$homeland_area = esc_attr(get_post_meta($post->ID, 'homeland_area', true));
$homeland_area_unit = esc_attr(get_post_meta( $post->ID, 'homeland_area_unit', true ) );
$homeland_floor_area = esc_attr( get_post_meta( $post->ID, 'homeland_floor_area', true ) );
$homeland_floor_area_unit = esc_attr( get_post_meta( $post->ID, 'homeland_floor_area_unit', true ) );
$homeland_bedroom = esc_attr( get_post_meta($post->ID, 'homeland_bedroom', true) );
$homeland_bathroom = esc_attr( get_post_meta($post->ID, 'homeland_bathroom', true) );
$homeland_garage = esc_attr( get_post_meta($post->ID, 'homeland_garage', true) );
$homeland_property_sold = esc_attr( get_post_meta($post->ID, 'homeland_property_sold', true) );
$homeland_property_status = get_the_terms ( $post->ID, 'homeland_property_status' );
?>
<li id="post-<?php the_ID(); ?>" class="featured-list clearfix">
<?php if ( post_password_required() ) : ?>
<div class="password-protect-thumb featured-pass-thumb">
<i class="fa fa-lock fa-2x"></i>
</div>
<?php else : ?>
<figure class="feat-thumb">
<a href="<?php the_permalink(); ?>">
<?php 
if ( has_post_thumbnail() ) : 
the_post_thumbnail(); 
else :
echo '<img src="'. get_template_directory_uri() .'/img/no-property-image.png" title="" alt="" />';
endif; 
?>
</a>
<figcaption>
<a href="<?php the_permalink(); ?>">
<i class="fa fa-link fa-lg"></i>
</a>
</figcaption>
<?php
if(!empty($homeland_property_sold)) :
echo "<h4 class='property-sold'>". esc_html__('Sold', 'homeland') ."</h4>";
else : 
if(!empty( $homeland_property_status )) : ?>
<h4>
<?php foreach($homeland_property_status as $homeland_sterm) : ?>
<span class="<?php echo $homeland_sterm->slug; ?>"><?php echo $homeland_sterm->name; ?></span>
<?php endforeach; ?>
</h4><?php
endif; 
endif;
?>
</figure>
<?php endif; ?>
<div class="feat-desc">
<?php 
the_title( '<h5><a href="' . get_permalink() . '">', '</a></h5>' ); 
?>
<span>
<?php 
if($homeland_preferred_size == "Floor Area") :
if(!empty($homeland_floor_area)) :
echo esc_html( $homeland_floor_area ) . "&nbsp;" . esc_html( $homeland_floor_area_unit ) . ", "; 
endif;
else :
if(!empty($homeland_area)) :
echo esc_html( $homeland_area ) . "&nbsp;" . esc_html( $homeland_area_unit ) . ", "; 
endif;
endif;
if(!empty($homeland_bedroom)) :
echo esc_html( $homeland_bedroom ) . "&nbsp;"; esc_html_e( 'Bedrooms', 'homeland' ); echo ", "; 
endif;
if(!empty($homeland_bathroom)) :
echo esc_html( $homeland_bathroom ) . "&nbsp;"; esc_html_e( 'Bathrooms', 'homeland' ); echo ", "; 
endif;
if(!empty($homeland_garage)) :
echo esc_html( $homeland_garage ) . "&nbsp;"; esc_html_e( 'Garage', 'homeland' ); 
endif;
?>
</span>
<?php if(!empty($homeland_price) ) : ?>
<span class="price"><?php homeland_property_price_format(); ?></span>
<?php endif; ?>
</div>
</li><?php
endwhile;
?>
</ul>
</div><?php
endif;
?>
</div>
<?php
}
endif;
---------------------------------------------------------------------------------------------------------


UNA DE LAS TRES COLUMNAS HECHAS A BASE DEL ANTERIOR CODIGO:

<?php
/* VENTA */

if ( ! function_exists( 'homeland_venta' ) ) :
function homeland_venta() {
global $post;

$homeland_album_order = esc_attr( get_option('homeland_album_order') );
$homeland_album_orderby = esc_attr( get_option('homeland_album_orderby') );
$homeland_featured_property_limit = esc_attr( get_option('homeland_featured_property_limit') );
$homeland_featured_property_header = esc_attr( get_option('homeland_featured_property_header') );
$homeland_price_format = esc_attr( get_option('homeland_price_format') );
$homeland_currency = esc_attr( get_option('homeland_property_currency') ); 
$homeland_property_currency_sign = esc_attr( get_option('homeland_property_currency_sign') ); 
$ = esc_attr( get_option('homeland_preferred_size') ); 
$homeland_featured_property_header_label = !empty($homeland_featured_property_header) ? $homeland_featured_property_header : esc_html__('Featured Property', 'homeland');
?>
<div class="featured-block">
<h3><span>VENTA</span></h3>
<?php
$args = array( 
'post_type' => 'homeland_properties', 
'orderby' => $homeland_album_orderby, 
'order' => $homeland_album_order, 
'posts_per_page' => $homeland_featured_property_limit, 
'meta_query' => array( array( 
'key' => 'homeland_featured', 
'value' => 'on', 
'compare' => '==' 
))
);
$wp_query = new WP_Query( $args );

if ($wp_query->have_posts()) : ?>
<div class="grid cs-style-3">
<ul>
<?php
while ($wp_query->have_posts()) : 
$wp_query->the_post(); 
$homeland_price_per = esc_attr(get_post_meta( $post->ID, 'homeland_price_per', true));
$homeland_price = esc_attr(get_post_meta($post->ID, 'homeland_price', true));
$homeland_area = esc_attr(get_post_meta($post->ID, 'homeland_area', true));
$homeland_area_unit = esc_attr(get_post_meta( $post->ID, 'homeland_area_unit', true ) );
$homeland_floor_area = esc_attr( get_post_meta( $post->ID, 'homeland_floor_area', true ) );
$homeland_floor_area_unit = esc_attr( get_post_meta( $post->ID, 'homeland_floor_area_unit', true ) );
$homeland_bedroom = esc_attr( get_post_meta($post->ID, 'homeland_bedroom', true) );
$homeland_bathroom = esc_attr( get_post_meta($post->ID, 'homeland_bathroom', true) );
$homeland_garage = esc_attr( get_post_meta($post->ID, 'homeland_garage', true) );
$homeland_property_sold = esc_attr( get_post_meta($post->ID, 'homeland_property_sold', true) );
$homeland_property_status = get_the_terms ( $post->ID, 'homeland_property_status' );
?>
<li id="post-<?php the_ID(); ?>" class="featured-list clearfix">
<?php if ( post_password_required() ) : ?>
<div class="password-protect-thumb featured-pass-thumb">
<i class="fa fa-lock fa-2x"></i>
</div>
<?php else : ?>
<figure class="feat-thumb">
<a href="<?php the_permalink(); ?>">
<?php 
if ( has_post_thumbnail() ) : 
the_post_thumbnail(); 
else :
echo '<img src="'. get_template_directory_uri() .'/img/no-property-image.png" title="" alt="" />';
endif; 
?>
</a>
<figcaption>
<a href="<?php the_permalink(); ?>">
<i class="fa fa-link fa-lg"></i>
</a>
</figcaption>
<?php
if(!empty($homeland_property_sold)) :
echo "<h4 class='property-sold'>". esc_html__('Sold', 'homeland') ."</h4>";
else : 
if(!empty( $homeland_property_status )) : ?>
<h4>
<?php foreach($homeland_property_status as $homeland_sterm) : ?>
<span class="<?php echo $homeland_sterm->slug; ?>"><?php echo $homeland_sterm->name; ?></span>
<?php endforeach; ?>
</h4><?php
endif; 
endif;
?>
</figure>
<?php endif; ?>
<div class="feat-desc">
<?php 
the_title( '<h5><a href="' . get_permalink() . '">', '</a></h5>' ); 
?>
<span>
<?php 
if($homeland_preferred_size == "Floor Area") :
if(!empty($homeland_floor_area)) :
echo esc_html( $homeland_floor_area ) . "&nbsp;" . esc_html( $homeland_floor_area_unit ) . ", "; 
endif;
else :
if(!empty($homeland_area)) :
echo esc_html( $homeland_area ) . "&nbsp;" . esc_html( $homeland_area_unit ) . ", "; 
endif;
endif;
if(!empty($homeland_bedroom)) :
echo esc_html( $homeland_bedroom ) . "&nbsp;"; esc_html_e( 'Bedrooms', 'homeland' ); echo ", "; 
endif;
if(!empty($homeland_bathroom)) :
echo esc_html( $homeland_bathroom ) . "&nbsp;"; esc_html_e( 'Bathrooms', 'homeland' ); echo ", "; 
endif;
if(!empty($homeland_garage)) :
echo esc_html( $homeland_garage ) . "&nbsp;"; esc_html_e( 'Garage', 'homeland' ); 
endif;
?>
</span>
<?php if(!empty($homeland_price) ) : ?>
<span class="price"><?php homeland_property_price_format(); ?></span>
<?php endif; ?>
</div>
</li><?php
endwhile;
?>
</ul>
</div><?php
endif;
?>
</div>
<?php
}
endif;
?>

Compartir este mensaje


Enlace a mensaje
Compartir con otras webs

Crear una cuenta o conéctate para comentar

Necesitas ser usuario para poder dejar un comentario

Crear una cuenta

Registrarse para una nueva cuenta en nuestra comunidad. ¡Es fácil!


Registrar una nueva cuenta

Conectarse

¿Ya tienes una cuenta? Conéctate aquí.


Conéctate ahora
Conéctate para seguir esto  
Seguidores 0