Title: Need help with some PHP code
Last modified: August 20, 2016

---

# Need help with some PHP code

 *  [cmbuchanan](https://wordpress.org/support/users/cmbuchanan/)
 * (@cmbuchanan)
 * [14 years ago](https://wordpress.org/support/topic/need-help-with-some-php-code/)
 * I hope I’m posting this in the right place. One of my clients had someone built
   him a custom wordpress theme, but the original designer didn’t add the finishing
   touches. I’m stuck on some php coding that I can’t figure out. One the home page
   [http://chuckwardrealestate.com/](http://chuckwardrealestate.com/) you’ll see
   the featured properties section. This is the code calling this featured properties
   box:
 * _[ Code edited with backticks. Moderator note: when sharing code examples, please
   wrap the code in backticks or use the code button. ]_
 *     ```
       <div class="bordercontent"><h2> Featured Properties </h2></div>
   
       			<div class="topleftimagecontent">
   
       			<?php query_posts('cat=4&posts_per_page=6');
       			if (have_posts()) : while (have_posts()) : the_post(); ?>
       			<div class="topFeaturedimage">
       			  <div class="Featuredimage"><?php the_post_thumbnail();?></div>
       			  <div class="Featuredtitle"> <p> <?php the_title(); ?></p></div>
       			</div>
       			<?php endwhile; endif; ?>
       			<?php wp_reset_query(); ?>
       		</div>
       	</div>
       </div>
       ```
   
 * The appearance is fine, but I need to add functionality. What I want to happen
   is to make the images clickable so that you can go to the posts where the images
   are. I don’t know enough about php to write this code. Can anyone help me with
   this?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years ago](https://wordpress.org/support/topic/need-help-with-some-php-code/#post-2763152)
 *     ```
       <div class="Featuredimage"><a href="<?php the_permalink(); ?>"><?php the_post_thumbnail();?></a></div>
       ```
   
 * [http://codex.wordpress.org/Function_Reference/the_permalink](http://codex.wordpress.org/Function_Reference/the_permalink)
 *  Thread Starter [cmbuchanan](https://wordpress.org/support/users/cmbuchanan/)
 * (@cmbuchanan)
 * [14 years ago](https://wordpress.org/support/topic/need-help-with-some-php-code/#post-2763359)
 * Thank you so much! That’s exactly what I needed to know. I knew it would be something
   simple that would make me want to smack myself on the head for not figuring it
   out.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Need help with some PHP code’ is closed to new replies.

## Tags

 * [php code](https://wordpress.org/support/topic-tag/php-code/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [cmbuchanan](https://wordpress.org/support/users/cmbuchanan/)
 * Last activity: [14 years ago](https://wordpress.org/support/topic/need-help-with-some-php-code/#post-2763359)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
