WordPress.org

Support

Support » Themes and Templates » Mansion Theme > Thumbnail on Every Images

Mansion Theme > Thumbnail on Every Images

  • Hello.

    I am trying to manage the Mansion Theme from graphpaperpress.com
    I have problem that the Main page shows every thumbnail images from each Post.\
    It shows thumbnails of every images in the Gallery on the main page, it doesn’t seem to relate with Featured Image setup.

    I would like to show only One thumbnail images per Post on the Main page, and show multiple images in the Post.

    How can I change this?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • <?php
    if ( function_exists('register_sidebar') )
        register_sidebar();
    
    // Add Post Thumbnail Theme Support
    if ( function_exists( 'add_theme_support' ) ) {
    	add_theme_support( 'post-thumbnails' );
    	add_image_size( 'featured', 390, 260, true );
    }
    
    $includes_path = TEMPLATEPATH . '/includes/';
    
    // load javascripts
    require_once ($includes_path . 'theme-js.php');
    
    //get thumbnail
    function postimage($size=medium) {
    	if ( $images = get_children(array(
    		'post_parent' => get_the_ID(),
    		'post_type' => 'attachment',
    		'numberposts' => 1,
    		'order' => 'ASC',
    		'post_mime_type' => 'image',)))
    	{
    		foreach( $images as $image ) {
    			$attachmentimage=wp_get_attachment_image( $image->ID, $size );
    			echo $attachmentimage.apply_filters('the_title', $parent->post_title);
    		}
    	}
    }
    
    //get thumbnails
    function postimages($size=medium) {
    	if ( $images = get_children(array(
    		'post_parent' => get_the_ID(),
    		'post_type' => 'attachment',
    		'post_mime_type' => 'image')))
    	{
    		foreach( $images as $image ) {
    			$attachmenturl=wp_get_attachment_url($image->ID);
    
    			if($size=='featured') {
    				$attachmentimage=wp_get_attachment_image( $image->ID, array(390, 260) );
    			} else {
    				$attachmentimage=wp_get_attachment_image( $image->ID, $size );
    			}
    
    			$imagelink=get_permalink($image->post_parent);
    
    			echo '<div class="box"><a href="'.$imagelink.'">'.$attachmentimage.apply_filters('the_title', $parent->post_title).'</a></div>';
    		}
    	}
    }
    
    //check any attachment
    function checkimage($size=medium) {
    	if ( $images = get_children(array(
    		'post_parent' => get_the_ID(),
    		'post_type' => 'attachment',
    		'numberposts' => 1,
    		'post_mime_type' => 'image',)))
    	{
    		foreach( $images as $image ) {
    			$attachmentimage=wp_get_attachment_image( $image->ID, $size );
    			return $attachmentimage;
    		}
    	}
    }
    
    function trim_excerpt($text) {
      return rtrim($text,'[...]');
    }
    add_filter('get_the_excerpt', 'trim_excerpt');
    function new_excerpt_length($length) {
    	return 30;
    }
    add_filter('excerpt_length', 'new_excerpt_length');
    
    ?>

    This is the Function code that seems control the thumbnail on the main page..
    Would you help me to know which part should I change?

    hello,
    i’m having the same problem on mansion. did you find a way to solve it?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Mansion Theme > Thumbnail on Every Images’ is closed to new replies.