Viewing 1 replies (of 1 total)
  • Thread Starter gordo019

    (@gordo019)

    Add this to functions.php…

    function my_shortcode_to_a_post( $content ) {
    global $post;
    if( ! $post instanceof WP_Post ) return $content;

    switch( $post->post_type ) {
    case ‘download’:
    return $content . ‘[edd_download_images]’;
    default:
    return $content;
    }
    }

    add_filter( ‘the_content’, ‘my_shortcode_to_a_post’ );

Viewing 1 replies (of 1 total)
  • The topic ‘short code’ is closed to new replies.