• Resolved Sheldon-64

    (@sheldon-64)


    I am using your code from previous post, want to publish Sermons from the Sermon Manager plugin.

    My code is

    if((get_post_type($my_post->ID) != 'post')  && (get_post_type($my_post->ID)) != 'Sermon') { // only do this for posts and sermons
    			return;

    Normal posts still are publishing so I’m assuming the post ID is not actually ‘Sermon’. Any idea how I would determine the correct type?

    https://www.ads-software.com/plugins/wpbook-lite/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Eckman

    (@johneckman)

    Looks like you have a missing parenthesis:

    if( (get_post_type($my_post->ID) != 'post')  && (get_post_type($my_post->ID)) != 'Sermon') ) { // only do this for posts and sermons
    			return;

    Looking at sermon manager plugin (assuming you mean this one: https://www.ads-software.com/plugins/sermon-manager-for-wordpress/ ) it looks like they register a post type of “wpfc_sermon” so that would mean this code:

    if( (get_post_type($my_post->ID) != 'post')  && (get_post_type($my_post->ID)) != 'wpfc_sermon') ) { // only do this for posts and sermons
    			return;

    Should work.

    Thread Starter Sheldon-64

    (@sheldon-64)

    Adding the parenthesis throws an error on publish.

    But you identified the correct post type, so it does publish to facebook (although there is an error message in the description of the post), but I will start a separate topic.

    Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Post Type not working’ is closed to new replies.