0

Checking for front page with either is_home() or is_front_page() still removes the edit link from all pages/posts. What's wrong with this?

add_filter( 'edit_post_link', 'foo_edit_post_link' );

function foo_edit_post_link() {

  if (is_home()) {
   return FALSE;
  }
}

2 Answers 2

1

Try

function foo_edit_post_link($link) {
  if (is_home()) {
   return FALSE;
  }
    return $link;
}
1
  • Almost. Had to also change the homepage check to if(is_home() || is_front_page()).
    – kidrobot
    Jan 26, 2012 at 3:33
0

Assuming you're using a custom template why not just remove the_loop from your template?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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