Añadir evangelio plegable a comentarios
Co-authored-by: rafa <rcalvotorrejon@gmail.com> Signed-off-by: rafa <rcalvotorrejon@gmail.com>
This commit is contained in:
@@ -2044,8 +2044,12 @@ add_filter('the_content', function($content) {
|
||||
global $post;
|
||||
if (!in_category('comentarios-al-evangelio', $post)) return $content;
|
||||
|
||||
$carta_id = get_post_meta($post->ID, '_carta_id', true);
|
||||
$cita = get_post_meta($post->ID, '_cita_evangelio', true);
|
||||
$carta_id = function_exists('fea_evangelio_comment_meta')
|
||||
? fea_evangelio_comment_meta($post->ID, '_carta_id')
|
||||
: get_post_meta($post->ID, '_carta_id', true);
|
||||
$cita = function_exists('fea_evangelio_comment_meta')
|
||||
? fea_evangelio_comment_meta($post->ID, '_cita_evangelio')
|
||||
: get_post_meta($post->ID, '_cita_evangelio', true);
|
||||
|
||||
if (!$carta_id && !$cita) return $content;
|
||||
|
||||
@@ -2066,23 +2070,6 @@ add_filter('the_content', function($content) {
|
||||
}
|
||||
}
|
||||
|
||||
// --- Cita del evangelio — link directo al anchor en el índice ---
|
||||
if ($cita) {
|
||||
$book_post_id = ['Mt' => 43908, 'Mc' => 43909, 'Lc' => 43907, 'Jn' => 43906];
|
||||
$abbr = substr($cita, 0, 2);
|
||||
$anchor = fea_cita_to_anchor($cita);
|
||||
$index_url = isset($book_post_id[$abbr])
|
||||
? esc_url(get_permalink($book_post_id[$abbr]) . '#' . $anchor)
|
||||
: '';
|
||||
|
||||
$html .= '<div class="fea-com-row fea-com-cita">'
|
||||
. '<span class="fea-com-label">Evangelio</span>'
|
||||
. ($index_url
|
||||
? '<a href="' . $index_url . '">' . esc_html($cita) . '</a>'
|
||||
: '<span>' . esc_html($cita) . '</span>')
|
||||
. '</div>';
|
||||
}
|
||||
|
||||
// --- Otros comentarios de esta misma cita ---
|
||||
if ($cita) {
|
||||
$others = get_posts([
|
||||
|
||||
Reference in New Issue
Block a user