WordPress.org

Ready to get started?Download WordPress

Forums

Ambrosite Next/Previous Post Link Plus
[resolved] Post Type Bug (5 posts)

  1. dalla777
    Member
    Posted 1 year ago #

    I'm getting this DB error: WordPress database error: [Unknown column 'staffmembers' in 'where clause']

    The SQL:
    AND p.post_type IN (staffmembers) AND

    I simply went into line 190 in the plugin and added single quotes to the query -
    AND p.post_type IN ('$post_type') AND

    This seems to have fixed the problem. If other people are having post type problems, this is probably why.

    http://wordpress.org/extend/plugins/ambrosite-nextprevious-post-link-plus/

  2. ambrosite
    Member
    Plugin Author

    Posted 1 year ago #

    I assume you are using the post_type parameter to set a custom post type. Did you remember to format the parameter value exactly as shown in the plugin instructions? If not, that would cause the error you saw. It is not a bug.

    From the instructions:

    The string must be formatted exactly as shown here, with each post type enclosed in double quotes, and separated by commas:

    <?php next_post_link_plus( array('post_type' => ' "post","event" ') ); ?>

  3. dalla777
    Member
    Posted 1 year ago #

    Ah I guess I missed that, since that's not standard wordpress procedure. Curious why you set it up this way? I have only recently been developing plugins and am always wanting to learn more from others. Thanks!

  4. ambrosite
    Member
    Plugin Author

    Posted 1 year ago #

    I set it up that way to make it possible for people to pass multiple custom post types, as shown in the example. In fact, that is the only reason to ever use the post_type parameter, as I explain in the documentation:

    The post_type parameter is intended for advanced users. 95% of the time there is no need to set this parameter; the plugin is smart enough to auto-detect custom post types and deal with them correctly. The only reason you would need to specify the post_type is if you are trying to do something weird like having posts from two different types appear in the same navigation stream.

  5. ambrosite
    Member
    Plugin Author

    Posted 1 year ago #

    Since it has been established that this is not a bug, I am marking this thread as resolved. If you have any more questions about the plugin, feel free to start a new thread.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.