• Hi, I have been trying for days to get a function working. Basically I want to hook into the $content only on Posts and not Pages. This displays on every page. Just cannot think what is wrong with it. Any help would be much appreciated.

    if (!is_single() || get_post_type() == 'post') {
    function add_form_to_post( $content ) {
        $custom_content = '[contact-form-7 id="73" title="Blogger Response"]';
        $content.= $custom_content;
        return $content;
    }
    add_filter( 'the_content', 'add_form_to_post' );
    } {
      // blank
    }
  • The topic ‘Cannot Get is_single() working – Help’ is closed to new replies.