Cannot Get is_single() working – Help

  • Unknown's avatar

    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
    }
  • Unknown's avatar

    Hello.

    Adding functions to your WordPress files is a feature of a self-hosted install. Questions about self-hosted WordPress (better known WordPress.org) sites can be directed to the support forums at https://wordpress.org/support/

    To learn more about the difference between WordPress.com and WordPress.org (self-hosted), please review the differences here http://en.support.wordpress.com/com-vs-org/

  • The topic ‘Cannot Get is_single() working – Help’ is closed to new replies.