problemas con la plantilla homeland de themeforest
Publicado por word (2 intervenciones) el 24/01/2017 14:12:46
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".
Adjunto 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:
---------------------------------------------------------------------------------------------------------
UNA DE LAS TRES COLUMNAS HECHAS A BASE DEL ANTERIOR CODIGO:
Adjunto 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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/* 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 ) . " " . esc_html( $homeland_floor_area_unit ) . ", ";
endif;
else :
if(!empty($homeland_area)) :
echo esc_html( $homeland_area ) . " " . esc_html( $homeland_area_unit ) . ", ";
endif;
endif;
if(!empty($homeland_bedroom)) :
echo esc_html( $homeland_bedroom ) . " "; esc_html_e( 'Bedrooms', 'homeland' ); echo ", ";
endif;
if(!empty($homeland_bathroom)) :
echo esc_html( $homeland_bathroom ) . " "; esc_html_e( 'Bathrooms', 'homeland' ); echo ", ";
endif;
if(!empty($homeland_garage)) :
echo esc_html( $homeland_garage ) . " "; 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:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?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 ) . " " . esc_html( $homeland_floor_area_unit ) . ", ";
endif;
else :
if(!empty($homeland_area)) :
echo esc_html( $homeland_area ) . " " . esc_html( $homeland_area_unit ) . ", ";
endif;
endif;
if(!empty($homeland_bedroom)) :
echo esc_html( $homeland_bedroom ) . " "; esc_html_e( 'Bedrooms', 'homeland' ); echo ", ";
endif;
if(!empty($homeland_bathroom)) :
echo esc_html( $homeland_bathroom ) . " "; esc_html_e( 'Bathrooms', 'homeland' ); echo ", ";
endif;
if(!empty($homeland_garage)) :
echo esc_html( $homeland_garage ) . " "; 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;
?>
- homeland.rar(6,6 MB)
Valora esta pregunta
0