• hello, i wanted to execute a php code when a new custom post type is created…so when a customer creates a wordpress post from frontend the php code will be executed can you help me

Viewing 2 replies - 1 through 2 (of 2 total)
  • If you want to execute php code only on custom post type,you can use
    is_singular( $post_types ) function.For example if you want to display something only on custom post type book, then you can use like following
    if(is_singular( ‘book’ )) {
    echo “Hii”;
    }

    Thread Starter miko1997

    (@miko1997)

    thank you that worked fine

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘executing php code in custom post type’ is closed to new replies.