From 62e8e1ebb38a9200bc744629a5f88e2c32eda5b1 Mon Sep 17 00:00:00 2001 From: roberto Date: Mon, 10 Mar 2014 12:15:56 +0000 Subject: [PATCH] =?UTF-8?q?Se=20reduce=20el=20=C3=A1rbol=20hasta=20los=20a?= =?UTF-8?q?buelos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.DoubleRGroup_Web/trunk@5 9702d7ca-3799-984c-9d87-892b02c0b615 --- .../framework/custom_shortcodes.php | 43 +++++++++---------- .../double-r-group/partials/horse-list.php | 4 +- 2 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/wp-content/themes/double-r-group/framework/custom_shortcodes.php b/src/wp-content/themes/double-r-group/framework/custom_shortcodes.php index ec75b83..ca20102 100644 --- a/src/wp-content/themes/double-r-group/framework/custom_shortcodes.php +++ b/src/wp-content/themes/double-r-group/framework/custom_shortcodes.php @@ -26,13 +26,9 @@ add_shortcode('horse_family_tree', 'drg_horse_family_tree'); function drg_horse_family_tree($atts, $content = null) { global $post; $html = ''; - - extract(shortcode_atts(array( - 'horse_id' => $post->ID, - ), $atts)); - + $query_atts = array( - 'p' => $atts['horse_id'], + 'p' => empty($atts['horse_id']) ? $post->ID : $atts['horse_id'], 'post_type' => 'drg_horse', 'paged' => 1, 'posts_per_page' => 1, @@ -40,10 +36,11 @@ function drg_horse_family_tree($atts, $content = null) { wp_reset_query(); $horses = new WP_Query($query_atts); + $html .= '
'; - while($horses->have_posts()): $horses->the_post(); + while($horses->have_posts()): $horses->the_post(); $html .= '' . get_the_title() . ''; // Padres @@ -58,10 +55,10 @@ function drg_horse_family_tree($atts, $content = null) { $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_paternal_grandfather', true) . ''; // Bisabuelos paternos (1) - $html .= '
'; - $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandfather_1', true) . '
'; - $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandmother_1', true) . '
'; - $html .= '
'; +// $html .= '
'; +// $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandfather_1', true) . '
'; +// $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandmother_1', true) . '
'; +// $html .= '
'; $html .= '
'; // Abuelo paterno @@ -69,10 +66,10 @@ function drg_horse_family_tree($atts, $content = null) { $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_paternal_grandmother', true) . ''; // Bisabuelos paternos (2) - $html .= '
'; - $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandfather_2', true) . '
'; - $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandmother_2', true) . '
'; - $html .= '
'; + // $html .= '
'; + // $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandfather_2', true) . '
'; + // $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_paternal_great_grandmother_2', true) . '
'; + // $html .= '
'; $html .= '
'; // Abuela paterna @@ -88,10 +85,10 @@ function drg_horse_family_tree($atts, $content = null) { $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_maternal_grandfather', true) . ''; // Bisabuelos paternos (1) - $html .= '
'; - $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandfather_1', true) . '
'; - $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandmother_1', true) . '
'; - $html .= '
'; +// $html .= '
'; +// $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandfather_1', true) . '
'; +// $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandmother_1', true) . '
'; +// $html .= '
'; $html .= '
'; // Abuelo materno @@ -99,10 +96,10 @@ function drg_horse_family_tree($atts, $content = null) { $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_maternal_grandmother', true) . ''; // Bisabuelos naternos (2) - $html .= '
'; - $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandfather_2', true) . '
'; - $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandmother_2', true) . '
'; - $html .= '
'; +// $html .= '
'; +// $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandfather_2', true) . '
'; +// $html .= '
' . get_post_meta(get_the_ID(), 'drg_horse_maternal_great_grandmother_2', true) . '
'; +// $html .= '
'; $html .= '
'; // Abuela paterna diff --git a/src/wp-content/themes/double-r-group/partials/horse-list.php b/src/wp-content/themes/double-r-group/partials/horse-list.php index fd89617..642e6a5 100644 --- a/src/wp-content/themes/double-r-group/partials/horse-list.php +++ b/src/wp-content/themes/double-r-group/partials/horse-list.php @@ -223,12 +223,12 @@

ID, 'horse_breeds', '', ', ', ' '); $term_list .= get_the_term_list($post->ID, 'horse_ages', '', ', ', ' '); $term_list .= get_the_term_list($post->ID, 'horse_genders', '', ', ', ''); ?> -

+