Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Nicolas Juen

    (@rahe)

    Hi,

    You just have to add this part of code in the

    while(have_posts()):
    the_post()
    endwhile;

    part of you theme file, this have to be in the loop. If you wan to display a specific image you can use the get_the_post_thumbnail() function.

    Rahe

    Thread Starter Thirtyfour

    (@34-test)

    Hi,

    Thanks for reply :

    i created a custom size 828px X 567px for featured image. also i add php code in my theme functions file
    add_image_size( 'Home-slider', '828', '567', true );

    i used this code :-

    <?php $recent = new WP_Query("cat=&showposts=1"); while($recent->have_posts()) : $recent->the_post();?>
    
    <a href="<?php the_permalink() ?>" target="_blank"><?php the_title(); ?></a>
    
    <?php get_the_post_thumbnail('Home-slider') ?>
    
    <?php endwhile; ?>

    But not working Please Help.

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How can i add image in php files’ is closed to new replies.