Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter toshi182

    (@toshi182)

    used ‘responsive video embed’ plugin to fix this issue.

    Thread Starter toshi182

    (@toshi182)

    Okay. I managed the display css.

    but the widget is only visible in post.php
    I placed the widget in a general footer that show identically on every pages in wordpress.
    but the widget is invisible except the post page.

    any ideas?

    Thread Starter toshi182

    (@toshi182)

    I did put the php code in a extended text widget. it looks working. but it displays only vertically in a row.

    Thread Starter toshi182

    (@toshi182)

    <?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?

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