• Hi guys, iam still very new at PHP, and iam trying to create a magazine style wordpress, theme so i trying to create a query that only catch the Featured Image, and the title, so far a have this:

    function pegarcabelo() {
    	query_posts( array ( 'posts_per_page' =>3, 'cat' => 3 ));
    	while ( have_posts() ) : the_post();
    	echo '<div class="cabelobox">';
    	the_post_thumbnail( 'foto-inicial' );
            the_title();
    	echo '</div>';
    	endwhile;
    }

    Its working fine, but a simple cannot add the Permalink() in the title, what you be the best way to that?

Viewing 1 replies (of 1 total)
  • From the content.php twenty eleven theme:

    <a href="<?php the_permalink(); ?>"
       title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ),
       the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?>
    </a>

    For the image link un-tested something like

    <a href="<?php the_permalink(); ?>">
       <?php the_post_thumbnail( 'foto-inicial' ); ?>
    </a>

    HTH

    David

Viewing 1 replies (of 1 total)
  • The topic ‘How to add Permalink to title on query_posts’ is closed to new replies.