showing alt text instead of iamge
-
i have in my theme a problem its showing a large image in portfolio page and portfolio slider, now the slider get the image small (cropped) which is very bad looking, and i would like it show another image (smaller one i choose) taking the url from the alt tag in the big image.
my code currently is:
<div class="portfolio-thumb"> <?php $image = $portfolio->get_image( 'portfolio_section', array( 'class' => 'img-responsive' ) ); if ( strcmp( $image, '' ) != 0 ) { echo $image; } else { ?> <img src="<?php echo $portfolio->get( 'baseurl' ) ?>images/no-image.jpg" class="img-responsive" /> <?php } ?>
i tried modifying the
$image = $portfolio->get_image( 'portfolio_section', array( 'class' => 'img-responsive' ) ); if ( strcmp( $image, '' ) != 0 ) {
to be
$image = $portfolio->alt_image( 'portfolio_section', array( 'class' => 'img-responsive' ) ); if ( strcmp( $image, '' ) != 0 ) {
but i think this is wrong as when i apply it the full front page dont work…
any one could help?
thanks
mark
- The topic ‘showing alt text instead of iamge’ is closed to new replies.