El título no funciona como enlace

21 ene 2013, 00:47:03
Vistas: 74
Votos: 0

Sé que no hay una etiqueta de enlace alrededor del título, pero no sé dónde colocarla, por favor ayúdame :) Este es el código

if ($columns->have_posts()) :
    $count = 0;
        while ($columns->have_posts()) : $columns->the_post();
        $count++;
?>
        <div class="slide">
            <div class="slides_thumbnail">
                <a href="<?php the_permalink(); ?>">
                    <div style="width:190px;height:190px;background:url('<?php 
                     $img = get_the_post_thumbnail();
                    eregi("src=\"([^\"]+)\"", $img, $arr);

                    echo $arr[1]; ?>');">&nbsp;</div>

                    <span class="image overlay"></span>
                    <span class="description"></span>
                </a>
            </div><!-- .slides_thumbnail -->
            <h3 class='slide_title'>
                <a href="<?php the_permalink(); ?>">  <!-- Añadir etiqueta de enlace aquí -->
                <?php

                    $long_title = strip_tags(htmlspecialchars(get_the_title($post->ID)));
                    $short_title = substr($long_title,0,55);

                    if (strlen($long_title) !== strlen($short_title)) {
                        echo $short_title . "... ";
                    } else {
                        echo $short_title;
                    }
                    ?>
                </a>  <!-- Cerrar etiqueta de enlace -->
            </h3><!-- .slide_title -->

            <div class='slide_stats'>
                <?php $more_comments = get_comments_number() . ' Comentario(s)'; ?>
                <?php comments_number( "0 Comentario(s)", "1 Comentario(s)", $more_comments ); ?> 
            </div><!-- .slide_stats -->

            <div class="slides_text">
                <p>
                    <?php 
                    if(function_exists('the_excerpt_max_charlength')) {
                            the_excerpt_max_charlength(300); 
                        } else {
                            the_excerpt(); 
                        }
                    ?>
                </p>
            </div><!-- .slides_text -->
        </div><!-- .slide -->
<?php
    endwhile;
endif;
?>
    </div><!-- .slides_container -->
<?php
if($count > 1) :
?>
        <button class="slide_prev">Anterior</button>
        <button class="slide_next">Siguiente</button>
<?php
endif;
?>
</div><!-- .slides -->
0
Todas las respuestas a la pregunta 1
0

Necesitas colocarlo dentro de las etiquetas <h3>:

<h3 class='slide_title'>
    <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
        <?php
            $long_title = get_the_title(); // Obtener el título completo
            $short_title = substr( $long_title, 0, 55 ); // Obtener versión corta (55 caracteres)

            if ( strlen( $long_title ) !== strlen( $short_title ))  {
                echo $short_title . '&hellip;'; // Mostrar título corto con puntos suspensivos si fue truncado
            } else {
                echo $short_title; // Mostrar título completo si no fue truncado
            }
        ?>
    </a>
</h3><!-- .slide_title -->

También he arreglado un poco tu código del título :)

21 ene 2013 01:11:19