• Resolved sezernw

    (@sezernw)


    Hi,
    I created a post type slug named “10_soruda_evrenkent” using the Custom Post Type UI plugin. Thanks to this plugin, I can create posts other than wordpress’ internal posts. I can also add author box to posts of this post type. However, this post type does not appear in the posts tab on the profile page. How can I solve this problem. Thanks in advance.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi,

    We do have a function to which you can pass the CPT slug and it will return the profile tab content with posts of the custom CPT. You can try the following snippet which will create a shortcode ‘uwp_profile_my_cpt’ which you can use in the profile tab:

    add_shortcode('uwp_profile_my_cpt', 'uwp_profile_my_cpt_cb');
    function uwp_profile_my_cpt_cb(){
    	$user = uwp_get_displayed_user();
    	ob_start();
    	if(isset($user->ID)){
    		uwp_generic_tab_content( $user, '10_soruda_evrenkent', __( 'CPT Label', 'userswp' ) );
        }
    
        return ob_get_clean();
    }

    Let me know if it helps.

    Regards,
    Patrik

    Thread Starter sezernw

    (@sezernw)

    I’m so sorry but my coding knowledge is limited. Where should I add the code you shared?

    Hi,

    You can add this code in the functions.php file of currently active theme or via Code Snippets plugin on your site.

    Regards,
    Patrik

    Thread Starter sezernw

    (@sezernw)

    I solved my problem. Thank you so much. You are the best ?????

    Hi Patrik, I have a similar issue, I am using Divi engine to create the custom post type. Called it “talents”. Is it possible to do the same. I tried changing ’10_soruda_evrenkent’ to ‘events’ but cannot get it to work.

    Plugin Contributor Paolo

    (@paoltaia)

    Hi,

    1st thing you should check if the Divi engine plugin prefixes the name of the CPT created with it. If it does, make sure to use the full slug in the function.

    If it doesn’t, you say you called the CPT talents, you should change it to talents, not events, did you try that?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How can I show the posts of the Custom Post Type UI plugin in the profile tab’ is closed to new replies.