0

im using this piece of code to show my div only on homepage.

<?php if ( is_front_page() ) :?>

but it's shown on pagination 2, 3 and so on. is there any help regarding to fixing this issue?

  • 1
    did you try with is_home()? – Shameem Ali Apr 25 '18 at 17:35
1

Thank you guys for quick response. Here is the code that worked for me.

<?php if( is_home() != '' && !is_paged()) { ?>
    div here
<?php } ?>
-1

See: http://codex.wordpress.org/Function_Reference/is_home

<?php if(is_home()): ?>

 <div>Your div.</div>

<?php endif;?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.