WordPress.org

Ready to get started?Download WordPress

Forums

SuperCPT
[resolved] Not able to get SuperCPT too work (25 posts)

  1. Mike_sa
    Member
    Posted 1 year ago #

    Hi

    I am trying out the SuperCPT plugin but just cannot seem to get it too work.

    I have created a child theme using the canvas framework.

    I added

    add_action('init','test_post_type');
    function test_post_type(){
        if(!class_exists('Super_Custom_Post_Type'))
            return;
        $actors = new Super_Custom_Post_Type( 'actor' );
    }

    I added this in my functions file.
    It does not seem to do anything, what am I doing wrong.

    The superCPT plugin is activated ....

    Thanks

    http://wordpress.org/extend/plugins/super-cpt/

  2. Mike_sa
    Member
    Posted 1 year ago #

    I also created a plugin and activated it but it still does not appear :(

  3. Matthew Boynes
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Mike,
    Thanks for checking out the plugin! Before we dig into it too far, try one thing for me: instead of init, use after_setup_theme. Let me know if that resolves this for you!

    Cheers,
    Matt

  4. Mike_sa
    Member
    Posted 1 year ago #

    thanks for getting back to me so quickly :)

    I have tried that and still no luck.

    I supposed it is a silly question but having the plugin WCK Fields would not cause any clashes ?

  5. Matthew Boynes
    Member
    Plugin Author

    Posted 1 year ago #

    I'm not aware of any plugin compatibility issues, but that is entirely possible. for now, let's back-burner that and do some recon work.

    After adding that code, when you go to the WordPress admin panel, let's just confirm that you do not see "Actors" in the left sidebar. Is that correct?

    Next, if you go to /wp-admin/edit.php?post_type=actor, do you get a message that says "Invalid post type"?

    If "Yes" to both, can you please tell me what versions of WordPress and PHP you're running?

  6. Mike_sa
    Member
    Posted 1 year ago #

    Thats is a Yes :)

    I am running wordress 3.5.1 and canvas is the latest and on my localserver (mamp) I am running 5.3.5

  7. Mike_sa
    Member
    Posted 1 year ago #

    I also deactivated and remove WCK fields... no clash there :)

  8. Matthew Boynes
    Member
    Plugin Author

    Posted 1 year ago #

    OK, next up is making sure that that function call is getting hit at all. In your action hook, replace "test_post_type" with "wp_die" and see if that kills your site. If this is a live site, you obviously don't want to kill it, so we can try something else if that's the case.

    If that does kill your site, then undo that change and add wp_die(); to the end of your test_post_type() function.

    Let me know what happens with these.

  9. Mike_sa
    Member
    Posted 1 year ago #

    Yes it does kill the site and gives up a cannot redeclare error message.

    When I added it to the end of the function, nothing happen, site carried on working

    No the site is not live :)

  10. Mike_sa
    Member
    Posted 1 year ago #

    I think I must have misunderstood you :(

    I changed both the add_action and the function.... if I just change the add_action, nothing happens

  11. Matthew Boynes
    Member
    Plugin Author

    Posted 1 year ago #

    I think you mis-interpreted the first step. It sounds like you replaced function test_post_type() with function wp_die(). Instead, you should have changed the hook to be:

    add_action('after_setup_theme','wp_die');

    Does that indeed kill your site?

  12. Mike_sa
    Member
    Posted 1 year ago #

    no that does not kill the site

  13. Mike_sa
    Member
    Posted 1 year ago #

    correction, it does kill the site...bloody typo on the wp_die

  14. Mike_sa
    Member
    Posted 1 year ago #

    it also kills the site when wp_die is added to the end of the function :)

  15. Mike_sa
    Member
    Posted 1 year ago #

    I just removed the wp_die and it is suddenly working :)

    I must have had a typo, which I did check for that was just fixed :)

    Many thanks, it is resolved now. I look forward to playing with the plugin :)

    Thanks very very much for the help, especially on a friday :)

  16. Matthew Boynes
    Member
    Plugin Author

    Posted 1 year ago #

    OK Thanks. My last idea is that it's perhaps a plugin compatibility or a theme compatibility issue. If possible, can you disable all plugins except this one, and try the code in a different theme, like twenty twelve?

  17. Matthew Boynes
    Member
    Plugin Author

    Posted 1 year ago #

    Oh, fantastic! Glad to hear this is all sorted out!

    Cheers,
    Matt

  18. Mike_sa
    Member
    Posted 1 year ago #

    One last question :)

    Does the SuperCPt plugin have the option of repeater fields ?
    Thanks :)

  19. Matthew Boynes
    Member
    Plugin Author

    Posted 1 year ago #

    It does not, but it's on the very short list of upcoming features. I expect to roll that out, along with a few other things, within the next two weeks!

  20. Mike_sa
    Member
    Posted 1 year ago #

    Awesome, I can already see that I will prefer this plugin to Custom Post type UI and WCK Fields.

    Thanks for all the help, have an awesome weekend :)

  21. Matthew Boynes
    Member
    Plugin Author

    Posted 1 year ago #

    You too!

  22. Mike_sa
    Member
    Posted 1 year ago #

    Hi Mathew

    Sorry to bug you again... I am having an issue adding a meta box.... I keep geting the fatal error that the function add_meta_box is not defined .

    add_action('after_setup_theme','cont_boxes_home');
    function cont_boxes_home(){
        if(!class_exists('Super_Custom_Post_Meta'))
            return;
    
        $post_meta = new Super_Custom_Post_Meta('page');
        $post_meta = add_meta_box( array(
    	'id' => 'boxes',
    	'title' => 'content boxes',
            'context' => 'normal',
    	'fields' => array(
    		'content-box1' => array( 'type' => 'wysiwyg' )
    	)
    ) );
    
    }

    I tried using the add_action('add_meta_boxes','cont_boxes_home');

    Same error message....

    Have I done something wrong ?

  23. Mike_sa
    Member
    Posted 1 year ago #

    It is not my weekend for coding :D

    sorry saw it was a typo used = instead of ->

    Sorry for bothering you :)

  24. Matthew Boynes
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Mike,
    Glad to hear you figured that out!

    I've got a growing documentation resource at https://github.com/mboynes/super-cpt/wiki, where I've got some demos, and will continue adding more. Hopefully this will help you get the most out of the plugin!

    Cheers,
    Matt

  25. Mike_sa
    Member
    Posted 1 year ago #

    Thanks :)

    I am actually following it :D
    is there an option for just an upload button ?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.