Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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;
  }
}
share|improve this question

2 Answers 2

up vote 1 down vote accepted

Try

function foo_edit_post_link($link) {
  if (is_home()) {
   return FALSE;
  }
    return $link;
}
share|improve this answer
    
Yes, that's it. Thanks! –  kidrobot Jan 26 '12 at 0:57
    
Almost. Had to also change the homepage check to if(is_home() || is_front_page()). –  kidrobot Jan 26 '12 at 3:33

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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