Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author David Aguilera

    (@davilera)

    Hi @yuurisan.

    Can you please share a link to your blog? I’d like to see the widgets myself 😉

    Plugin Author David Aguilera

    (@davilera)

    What plugin are you using? You need to take a look at the template it uses for rendering the list of shared posts and make sure that the featured image is printed using the following function: (get_)the_post_thumbnail.

    My guess is, the plugin is using a different set of functions: get_post_thumbnail_id and wp_get_attachment_image_src. Therefore, the widget template probably looks like this:

    <?php
    $image_id = get_post_thumbnail_id( get_the_ID() );
    $image_thumb = wp_get_attachment_image_src( get_the_ID(), 'full', true );
    ?>
    <img src="<?php echo $image_thumb[0]; ?>" ... />

    If you change it to:

    <?php
    $image_id = get_post_thumbnail_id( get_the_ID() );
    $image_thumb = wp_get_attachment_image_src( get_the_ID(), 'full', true );
    if ( function_exists( 'uses_nelioefi' ) &&
         uses_nelioefi( get_the_ID() ) {
       $image_thumb = array( nelioefi_get_thumbnail_src( get_the_ID() ) );
    }
    ?>
    <img src="<?php echo $image_thumb[0]; ?>" ... />

    you’ll fix the issue.

    Page-content.php

    <div class=”<?php wptouch_post_classes(); ?>”>
    <div class=”post-page-head-area bauhaus”>
    <h2 class=”post-title heading-font”><?php the_title(); ?></h2>
    </div>
    <div class=”post-page-content”>
    <?php if ( bauhaus_should_show_thumbnail() && wptouch_has_post_thumbnail() ) { ?>
    <div class=”post-page-thumbnail”>
    <?php the_post_thumbnail(‘large’, array( ‘class’ => ‘post-thumbnail wp-post-image’ ) ); ?>
    </div>
    <?php } ?>
    <?php wptouch_the_content() ; ?>
    </div>
    </div>

    i dnt know to change, Please help

    Plugin Author David Aguilera

    (@davilera)

    Hi!

    I think the template you shared is the one used in a single post, and it works perfectly. Just take a look at this post in your blog: the first image is the featured image (it has the nelioefi class). Obviously, it works, because it uses the_post_thumbnail function.

    If you’re having trouble with a widget plugin, try contacting the author of said plugin and show him this thread. He may know what template has to be tweaked.

    Best,
    David

    It work in the post but not in the widget front page like here but on other widget it work http://i.imgur.com/X3KVq8D.png&#8230; that why I need to fix it… i did try the code u give me but it’s not working it give me err and using ur plugin and here is the code from the theme

    foreach($posts as $post)
    			{
    				$image_thumb = get_post_meta($post->ID, 'img_url', true);
    				$return_html.= '<li class="clearfix">';
    
    				$pm_video = get_post_meta($post->ID, 'pm_video_encode', true);
    				$pm_has_video = $pm_video != "";
    
    				$pm_overall_score = get_post_meta($post->ID, 'pm_overall_score', true);
    				$pm_review_enable = get_post_meta($post->ID, 'pm_review_enable', true);
    				$pm_review_type = get_post_meta($post->ID, 'pm_review_type', true);
    
    				if (has_post_thumbnail($post->ID))
    				{
    					$image_id = get_post_thumbnail_id($post->ID);
    					$image_url = wp_get_attachment_image_src($image_id, 'mini-thumbs', true);
    
    					$return_html.= '
    					<span class="img-frame">
    						<a href="'.get_permalink($post->ID).'">
    							<img src="'.$image_url[0].'" width="95" height="53" alt="'. $post->post_title .'" /></a>';
    
    						if ($pm_has_video) { $return_html.= '
    							<a href="'.get_permalink($post->ID).'"><span class="pm-icon"><i class="icon-play"></i></span></a>'; }
    
    					$return_html.= '
    					</span>';
    Plugin Author David Aguilera

    (@davilera)

    Hi yuurisan,

    In order to fix the issue, you have to override the variable “$image_url”. So, instead of this:

    ...
    $image_id = get_post_thumbnail_id($post->ID);
    $image_url = wp_get_attachment_image_src($image_id, 'mini-thumbs', true);
    
    $return_html .= '
    ...

    You need the following:

    ...
    $image_id = get_post_thumbnail_id($post->ID);
    $image_url = wp_get_attachment_image_src($image_id, 'mini-thumbs', true);
    if ( function_exists( 'uses_nelioefi' ) &&
         uses_nelioefi( $post->ID ) ) {
       $image_url = array( nelioefi_get_thumbnail_src( $post->ID ) );
    }//end if
    
    $return_html .= '
    ...

    Note the following:

    • The if has opening and closing brackets ({ and }).
    • The condition has two parts: the first one checks if a certain function exists (and it will, as long as our plugin is active), whereas the second part checks whether your current pos uses Nelio’s featured image plugin.
    • The parameter we use in our functions is $post->ID, because it’s the parameter used in your original code. See the param in get_post_thumbnail_id($post->ID);? That’s the one we need 😉
    • I hope this helps!

    it finally work thanks a lot man…. but i still getting this err when i am changing option in wp-admin

    Warning: Cannot modify header information – headers already sent by (output started at /inc/widgets/wg-sidebar.php:1) in /wp-includes/pluggable.php on line 1228

    when i go there in wg-sidebar.php

    <?php <---- this is line 1
    /*
    ==========================================================
    
    RECENT POSTS
    ==========================================================
    */

    in the pluggable.php

    $status = apply_filters( 'wp_redirect_status', $status, $location );
    
    	if ( ! $location )
    		return false;
    
    	$location = wp_sanitize_redirect($location);
    
    	if ( !$is_IIS && PHP_SAPI != 'cgi-fcgi' )
    		status_header($status); // This causes problems on IIS and some FastCGI setups
    
    this is the line 1228	header("Location: $location", true, $status);
    
    	return true;
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘It work like magic but some are not’ is closed to new replies.