Support » Plugins and Hacks » Include content, no title, from one post to another using shortcodes,

  • I’m trying to “include” the content (only) from a post into another post using shortcodes. It’s partially working. The problem is I am getting the title as well as the content, and I only want the content. Is there another way to do this? Or a way to fix the code shown below?

    The only info in an example post from my test site are the shortcodes:
    [digwp_include postidparam=”15″]
    [digwp_include postidparam=”16″]

    function digwp_includeContentShortcode( $atts ) {
         $thepostid = (int) $atts['postidparam'];
         if ( ! $post = get_post( $thepostid ) )
             return '<em>Invalid post/page ID.</em>';
             return apply_filters( 'the_content', $post->post_content );
    add_shortcode("digwp_include", "digwp_includeContentShortcode");
    // SHORTCODE USAGE On post content HTML tab use [digwp_include postidparam="#"]

    This code is from Automattic/Wordpress developer Viper007Bond who posted the code here, and later by email told me it should work.

  • The topic ‘Include content, no title, from one post to another using shortcodes,’ is closed to new replies.