WordPress.org

Forums

Co-Authors Plus
Issue with Custom Post Type and Display Posts Shortcode plugin (13 posts)

  1. tbadorrek
    Member
    Posted 2 years ago #

    I'm having an issue when assigning multiple co-authors to a custom post type. I can successfully assign the co-authors and they are all listed as authors in the backend. However, when I visit the author/archive page to view all posts that author has written, the custom post type only shows up in the "primary" author, not the other authors.

    I'm using the Display Posts Shortcode plugin and attempting to use the following shortcode:
    [display-posts post_type="research" author="editor"]

    However, when I use this code, the post only shows up for the primary author, not any of the co-authors.

    Thanks.

    http://wordpress.org/extend/plugins/co-authors-plus/

  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    Your co-authors are actually stored as a custom taxonomy. You can use something like this instead:

    [display-posts taxonomy="author" tax_term="editor" post_type="research"]

  3. tbadorrek
    Member
    Posted 2 years ago #

    Thank you. And it appears that only displays posts in which the author is listed as a co-author, not the first author. So I have to use my shortcode twice: once to display posts in which the person is the primary author, and again to display the posts in which the person is a co-author. Is this the way it's supposed to function? Is there any way to include all of these together (I'm trying to sort them by most recent)?

  4. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    There's a known limitation of the Co-Authors Plus plugin in that if you install it on a site where you've already been publishing for a while, it won't create author terms for all of the posts that have already been published.

    If you go into some of the posts that are missing and hit "Update", it will properly assign the term and the post will show up.

  5. tbadorrek
    Member
    Posted 2 years ago #

    Good to know. Thanks very much for that insight.

  6. tbadorrek
    Member
    Posted 2 years ago #

    Hi, I just updated to the most recent version and this solution no longer works. Is there a different format for taxonomy that's being used now?

    When I use [display-posts taxonomy="author" tax_term="editor" post_type="research"] nothing is displayed even though "editor" is manually reassigned to the posts they own.

  7. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    Odd. Does it work for other authors?

  8. tbadorrek
    Member
    Posted 2 years ago #

    It doesn't seem to be working for any author.

  9. tbadorrek
    Member
    Posted 2 years ago #

    For reference, my posts which I had previously tagged using the co-authors plugin still appear using this shortcode. However, when I create a new post or update an old post and assign new co-authors, they don't appear using taxonomy="author" and tax_term="author name"...

    If you're not sure right now, any chance I could get a copy of an older 2.9.x version of this plugin, as that seemed to work?

  10. tbadorrek
    Member
    Posted 2 years ago #

    And by that, I mean 2.6.4

  11. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    It would be better to get this fixed and released for the next version. Can you share the code you're using to register your CPT and a couple of example users (what their user_login and user_nicenames)? Did you edit the user nicenames?

  12. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 2 years ago #

    Oh, maybe there's an easier fix. Can you try prefixing your tax_term with 'cap-'?

  13. tbadorrek
    Member
    Posted 2 years ago #

    I just tried prefixing my tax_term with 'cap-', so that it says taxonomy="author" tax_term="cap-editor" but it didn't help. It could not find any posts.

    I'm using the Custom Post Types plugin. This is the code it generates:

    register_post_type('research', array(	'label' => 'Research','description' => '','public' => true,'show_ui' => true,'show_in_menu' => true,'capability_type' => 'post','hierarchical' => true,'rewrite' => array('slug' => 'research'),'query_var' => true,'menu_position' => 5,'supports' => array('title','editor','excerpt','custom-fields','revisions','thumbnail','author','page-attributes',),'labels' => array (
      'name' => 'Research',
      'singular_name' => 'Research',
      'menu_name' => 'Research',
      'add_new' => 'Add New',
      'add_new_item' => 'Add New Research',
      'edit' => 'Edit',
      'edit_item' => 'Edit Research',
      'new_item' => 'New Research',
      'view' => 'View Research',
      'view_item' => 'View Reseach',
      'search_items' => 'Search Research',
      'not_found' => 'No Research Found',
      'not_found_in_trash' => 'No Research found in Trash',
      'parent' => 'Parent Research',
    ),) );

    I did edit several of the user nicenames a while back from how they were originally created, in order to be consistent. Here are a couple of examples:
    user_login: ifwe-admin
    user_nicname: admin

    user_login:tbadorrek
    user_nicename: trevor-badorrek

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Co-Authors Plus
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.