• Hi,
    kindly you can know how to put a banner on very specific items present in the homepage?
    For example, a banner at the end of the second article, one at the end of the third and the last one at the end.

    Please, I await your response

    Thank you and good day

Viewing 2 replies - 1 through 2 (of 2 total)
  • in a standard loop, you can check the loop position with the variable $wp_query->current_post (starts with 0 zero for the first post in the loop);

    use that in a conditional statement in the loop of your homepage template, before the endwhile of the loop;
    example only:

    <?php if( $wp_query->current_post == 1 ) {
    	/*bannercode after second post*/
    } elseif( $wp_query->current_post == 2 ) {
    	/*bannercode after third post*/
    } elseif( $wp_query->current_post == $wp_query->post_count-1 ) {
    	/*bannercode after last post*/
    } ?>
    Thread Starter Alexander110

    (@alexander110)

    ok I’ll try,
    thank you, very kind and professional

    See you soon;)

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

The topic ‘Put banner in different post in homepage’ is closed to new replies.