Se reduce el árbol hasta los abuelos
git-svn-id: https://192.168.0.254/svn/Proyectos.DoubleRGroup_Web/trunk@5 9702d7ca-3799-984c-9d87-892b02c0b615
This commit is contained in:
parent
9d9e0dba4b
commit
62e8e1ebb3
@ -26,13 +26,9 @@ add_shortcode('horse_family_tree', 'drg_horse_family_tree');
|
|||||||
function drg_horse_family_tree($atts, $content = null) {
|
function drg_horse_family_tree($atts, $content = null) {
|
||||||
global $post;
|
global $post;
|
||||||
$html = '';
|
$html = '';
|
||||||
|
|
||||||
extract(shortcode_atts(array(
|
|
||||||
'horse_id' => $post->ID,
|
|
||||||
), $atts));
|
|
||||||
|
|
||||||
$query_atts = array(
|
$query_atts = array(
|
||||||
'p' => $atts['horse_id'],
|
'p' => empty($atts['horse_id']) ? $post->ID : $atts['horse_id'],
|
||||||
'post_type' => 'drg_horse',
|
'post_type' => 'drg_horse',
|
||||||
'paged' => 1,
|
'paged' => 1,
|
||||||
'posts_per_page' => 1,
|
'posts_per_page' => 1,
|
||||||
@ -40,10 +36,11 @@ function drg_horse_family_tree($atts, $content = null) {
|
|||||||
|
|
||||||
wp_reset_query();
|
wp_reset_query();
|
||||||
$horses = new WP_Query($query_atts);
|
$horses = new WP_Query($query_atts);
|
||||||
|
|
||||||
|
|
||||||
$html .= '<div id="horse-tree-' . $atts['horse_id'] . '" class="horse-tree">';
|
$html .= '<div id="horse-tree-' . $atts['horse_id'] . '" class="horse-tree">';
|
||||||
|
|
||||||
while($horses->have_posts()): $horses->the_post();
|
while($horses->have_posts()): $horses->the_post();
|
||||||
$html .= '<span class="label">' . get_the_title() . '</span>';
|
$html .= '<span class="label">' . get_the_title() . '</span>';
|
||||||
|
|
||||||
// Padres
|
// Padres
|
||||||
@ -58,10 +55,10 @@ function drg_horse_family_tree($atts, $content = null) {
|
|||||||
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_grandfather', true) . '</span>';
|
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_grandfather', true) . '</span>';
|
||||||
|
|
||||||
// Bisabuelos paternos (1)
|
// Bisabuelos paternos (1)
|
||||||
$html .= '<div class="branch lv3">';
|
// $html .= '<div class="branch lv3">';
|
||||||
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandfather_1', true) . '</span></div>';
|
// $html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandfather_1', true) . '</span></div>';
|
||||||
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandmother_1', true) . '</span></div>';
|
// $html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandmother_1', true) . '</span></div>';
|
||||||
$html .= '</div>';
|
// $html .= '</div>';
|
||||||
|
|
||||||
$html .= '</div>'; // Abuelo paterno
|
$html .= '</div>'; // Abuelo paterno
|
||||||
|
|
||||||
@ -69,10 +66,10 @@ function drg_horse_family_tree($atts, $content = null) {
|
|||||||
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_grandmother', true) . '</span>';
|
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_grandmother', true) . '</span>';
|
||||||
|
|
||||||
// Bisabuelos paternos (2)
|
// Bisabuelos paternos (2)
|
||||||
$html .= '<div class="branch lv3">';
|
// $html .= '<div class="branch lv3">';
|
||||||
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandfather_2', true) . '</span></div>';
|
// $html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandfather_2', true) . '</span></div>';
|
||||||
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandmother_2', true) . '</span></div>';
|
// $html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandmother_2', true) . '</span></div>';
|
||||||
$html .= '</div>';
|
// $html .= '</div>';
|
||||||
|
|
||||||
$html .= '</div>'; // Abuela paterna
|
$html .= '</div>'; // Abuela paterna
|
||||||
|
|
||||||
@ -88,10 +85,10 @@ function drg_horse_family_tree($atts, $content = null) {
|
|||||||
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_grandfather', true) . '</span>';
|
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_grandfather', true) . '</span>';
|
||||||
|
|
||||||
// Bisabuelos paternos (1)
|
// Bisabuelos paternos (1)
|
||||||
$html .= '<div class="branch lv3">';
|
// $html .= '<div class="branch lv3">';
|
||||||
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandfather_1', true) . '</span></div>';
|
// $html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandfather_1', true) . '</span></div>';
|
||||||
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandmother_1', true) . '</span></div>';
|
// $html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandmother_1', true) . '</span></div>';
|
||||||
$html .= '</div>';
|
// $html .= '</div>';
|
||||||
|
|
||||||
$html .= '</div>'; // Abuelo materno
|
$html .= '</div>'; // Abuelo materno
|
||||||
|
|
||||||
@ -99,10 +96,10 @@ function drg_horse_family_tree($atts, $content = null) {
|
|||||||
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_grandmother', true) . '</span>';
|
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_grandmother', true) . '</span>';
|
||||||
|
|
||||||
// Bisabuelos naternos (2)
|
// Bisabuelos naternos (2)
|
||||||
$html .= '<div class="branch lv3">';
|
// $html .= '<div class="branch lv3">';
|
||||||
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandfather_2', true) . '</span></div>';
|
// $html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandfather_2', true) . '</span></div>';
|
||||||
$html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandmother_2', true) . '</span></div>';
|
// $html .= '<div class="entry"><span class="label">' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandmother_2', true) . '</span></div>';
|
||||||
$html .= '</div>';
|
// $html .= '</div>';
|
||||||
|
|
||||||
$html .= '</div>'; // Abuela paterna
|
$html .= '</div>'; // Abuela paterna
|
||||||
|
|
||||||
|
|||||||
@ -223,12 +223,12 @@
|
|||||||
<h2 class="entry-title"><a href="<?php echo $permalink; ?>"><?php the_title(); ?></a></h2>
|
<h2 class="entry-title"><a href="<?php echo $permalink; ?>"><?php the_title(); ?></a></h2>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
$term_list = '';
|
$term_list = '';
|
||||||
$term_list .= get_the_term_list($post->ID, 'horse_breeds', '', ', ', ' ');
|
$term_list .= get_the_term_list($post->ID, 'horse_breeds', '', ', ', ' ');
|
||||||
$term_list .= get_the_term_list($post->ID, 'horse_ages', '', ', ', ' ');
|
$term_list .= get_the_term_list($post->ID, 'horse_ages', '', ', ', ' ');
|
||||||
$term_list .= get_the_term_list($post->ID, 'horse_genders', '', ', ', '');
|
$term_list .= get_the_term_list($post->ID, 'horse_genders', '', ', ', '');
|
||||||
?>
|
?>
|
||||||
<h4><?php echo $term_list ?></h4>
|
<h4><?php the_excerpt(); ?></h4>
|
||||||
<?php if (0) : ?>
|
<?php if (0) : ?>
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
<?php $excerpt_length = $data['excerpt_length_portfolio']; ?>
|
<?php $excerpt_length = $data['excerpt_length_portfolio']; ?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user