This is searchable archive of our old support forums, which operated from 2012 - 2016. To find out how to get support for your current theme, please visit our support page.

news-scroller plugin

  • Creator
    Topic
  • #1323
    deancs
    Participant

    The plug-in allows for display of featured images, however sometimes you may want to include a post that does not contain one. In these cases the plugin inserts an invalid tag and whilst it displays OK on ff,safari and chrome it reserves inherited margins and on IE8 it leaves a red check-box. The solution is simple, at line 317 in news-scroller.php modify the if-block to the following;

    <?php if( $instance['image'] == 'show' ) : ?>
    <?php
    $image = '';
    $image = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'grid_6' );
    if ($image[0] != '') : ?>


    <?php endif; ?>
    <?php endif; ?>

    Perhaps this could be included in a future update to the plug-in.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • #1324
    deancs
    Participant

    Code is not displayed correctly, try this;

    <?php if( $instance[\’image\’] == \’show\’ ) : ?>
    <?php
    $image = \’\’;
    $image = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), \’grid_6\’ );
    if ($image[0] != \’\’) : ?>


    <?php endif; ?>
    <?php endif; ?>

    #1325
    deancs
    Participant

    And on the third try he sees the note about pasting code…use pre tag

    <?php if( $instance['image'] == 'show' ) : ?>
    	<?php 
    		$image = '';
    		$image = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'grid_6' ); 
    		if ($image[0] != '') : ?>
    			
    			
    			
    		<?php endif; ?>									
    <?php endif; ?>
    #1333
    Jason Bobich
    Keymaster

    Thanks. I’ll look into it.

    #1334
    Jason Bobich
    Keymaster

    Note to self for future reference…

    I’m thinking this:

    <?php if( $instance['image'] == 'show' ) : ?>
    	<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'grid_6' ); ?>
    	
    <?php endif; ?>

    Will become this:

    <?php if( $instance['image'] == 'show' ) : ?>
    	<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'grid_6' ); ?>
    	<?php if( $image ) : ?>
    		
    <?php endif; ?> <?php endif; ?>
    #1372
    deancs
    Participant

    I have substituted your more elegant code and all is working.

    Thanks for the quick response.

    #1722
    Jason Bobich
    Keymaster
Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.