Support » Plugin: WPBook Lite » Enable Custom Post type

  • Resolved mnkhalid

    (@mnkhalid)


    Hi

    I installed wpbook lite on my website which uses custom post type for events. But when i upload events it does not get posted to my facebook. I tried to post a blog post and it did get posted. So it seems only custom posts dont. Please detail me how to enable custom posts

    thank you

    http://wordpress.org/plugins/wpbook-lite/

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

    (@johneckman)

    To enable custom post types you’ll need to edit some code.

    In wpbook-lite/includes/publish_to_facebook.php, find lines 97-99:

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

    What that basically says is if the post type of the current post is anything other than ‘post’ exit without posting.

    You would need something like:

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

    I say “something like” because the post type may not be labeled ‘event’

    If you just want ALL post types you could just remove that whole if statement.

    Exactly what I am looking for, just changed ‘if(‘ to ‘if((‘.

    I have no clue about coding, pretty pumped I figured that out!

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