• Hello,

    I’m trying to edit the Headway Themes pin-board.php template. This feature of Headway shows a vertical featured image, but it is cropped so that only the middle of the image is shown, not top or bottom. I’d like for only the top of the image to be shown once it is cropped.

    I have found the pin-board.php and believe it needs to be edited.

    From reading this article I believe I may need to add array( ‘right’, ‘top’ ) to the following code:

    /* Thumbnail */
    							if ( has_post_thumbnail() && $show_images ) {
    
    								$thumbnail_id = get_post_thumbnail_id();
    
    								$thumbnail_width = $approx_pin_width + 30; /* Add a 30px buffer to insure that image will be large enough */
    
    								//$crop_vertically
    								if ( $crop_images_vertically ) {
    
    									$thumbnail_height = round($approx_pin_width * 0.60);
    
    									$thumbnail_object = wp_get_attachment_image_src($thumbnail_id, 'full');
    									$thumbnail_url = headway_resize_image($thumbnail_object[0], $thumbnail_width, $thumbnail_height);
    									$full_image_url = $thumbnail_object[0];
    
    								} else {
    
    									$thumbnail_object = wp_get_attachment_image_src($thumbnail_id, 'full');
    									$thumbnail_url = headway_resize_image($thumbnail_object[0], $thumbnail_width);
    									$full_image_url = $thumbnail_object[0];
    
    								}
    
    								do_action('headway_before_pin_thumbnail');
    
    								echo '<div class="pin-board-pin-thumbnail">' . "\n";
    
    									if ( $image_click_action == 'post' ) {
    
    										echo '<a href="' . get_permalink() . '" class="post-thumbnail" title="' . $title_for_attribute . '">';
    											echo '<img src="' . esc_url($thumbnail_url) . '" alt="' . $title_for_attribute . '" />';
    										echo '</a>' . "\n";
    
    									} elseif ($image_click_action == 'popup') {
    
    										echo '<a href="' . esc_url($full_image_url) . '" class="thickbox post-thumbnail" rel="pinboard-'.$block['id'].'" title="' . $title_for_attribute . '">';
    											echo '<img src="' . esc_url($thumbnail_url) . '" alt="' . $title_for_attribute . '" />';
    										echo '</a>' . "\n";
    
    									} else {
    
    										echo '<a class="post-thumbnail"><img src="' . esc_url($thumbnail_url) . '" alt="' . $title_for_attribute . '" /></a>' . "\n";
    
    									}
    									if ( $show_pinterest_button || $show_twitter_button || $show_facebook_button ) {
    
    										echo '<div class="pin-board-pin-thumbnail-social">' . "\n";
    
    											if ( $show_facebook_button )
    												self::facebook_button(get_permalink(), $facebook_button_verb);
    
    											if ( $show_twitter_button )
    												self::twitter_button(get_permalink(), $title_for_attribute, $twitter_username, $twitter_hashtag);
    
    											if ( $show_pinterest_button ) {
    
    												$full_size_image = wp_get_attachment_image_src($thumbnail_id, 'full');
    												$full_size_image_url = $full_size_image[0];
    
    												self::pinterest_button(get_permalink(), $full_size_image_url);
    
    											}
    
    										echo '</div>' . "\n";
    
    									}
    
    								echo '</div>' . "\n\n";
    
    								do_action('headway_after_pin_thumbnail');
    
    							}
    						/* End Thumbnail */

    Any advice would be greatly appreciated!

The topic ‘Editing Headway Themes pin-board.php template’ is closed to new replies.