• Resolved SamTyurenkov

    (@samtyurenkov)


    Hello,

    I have custom post type called listings. It has many fields when editing, but doesn’t have author. I found the code in normal post

    <label class="inline-edit-author"><span class="title">Автор</span><select name='post_author' class='authors'>

    but I don’t know where to add it. Watching ftp files I only have edit.php, but I dont understand how to change edit.php?post_type=listings

    website: asp-polyana-sochi.ru theme: avenue

    I hope i gave clear explanation, if not please ask.

Viewing 5 replies - 1 through 5 (of 5 total)
  • If you are looking for the option to set an author for your custom post type then first you need to make sure that if the option exists it is also visible:
    Go to your backend and edit a listing CPT, then way top you should see a button called “Screen options” click that and you’ll get more check boxes see if any of them is for author if it is then make sure it’s checked and then look for an author settings options in your main article edit page.
    If the author check box is not available in the Screen options menu then you’ll have to edit the listings CPT registration code.
    For now check the options above and see if you can get what you need using the Screen options

    Thread Starter SamTyurenkov

    (@samtyurenkov)

    No screen option available.

    I have digged already to adding this function to functions.php

    <?php
    add_action('init', 'my_custom_init');
    function my_custom_init() {
    	add_post_type_support( 'listings', 'author' );
    }
    ?>

    But where do I put it and how to use ‘init’, ‘my_custom_init’?

    I don’t think you are going in the right direction.
    You should have screen options. Please check this image it will show you where to look for screen options (upper right corner)
    How did you created the CPT?

    Thread Starter SamTyurenkov

    (@samtyurenkov)

    I just added the above code in functions.php and it worked. Problem resolved.

    Congrats! I’m happy to hear you’ve managed to fix the issue!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add field to edit.php?post_type’ is closed to new replies.