Home » Topics » General Support » Some basic questions

Some basic questions

ACF Widgets Support General Support Some basic questions

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2247
    Johannes Tiner
    Participant

    Hey Daron,
    So i tried to buy this plug but got a 503 error, not sure what happend there. Did see that you could DL it from github to test it out so i did to see if i could include it in the theme without having it as a plugin. But what i get is an error after a widget is created:
    ‘( ! ) Warning: Missing argument 1 for ACFW_Widget::__construct(), called in C:\wamp\www\theme_name\wp-includes\widgets.php on line 560 and defined in C:\wamp\www\theme_name\wp-content\themes\camaleon\acfw\includes\ACFW_Widget.php on line 12’

    I assume that this guide is for doing just that? Hook page

    Seems like i have tried everything 😛

    It’s pretty much a blank WP install.
    It works exept for getting that big error once a widget is create.

    Would love some help, if this is doable im definitely buying a Dev license since this speeds up the widget creations.

    #2248
    Daron Spence
    Keymaster

    Hi Johannes, does the plugin work as expected when you do run it as a “plugin” installed normally? I want to verify that I didn’t introduce a bug in the dev branch…

    As to your error, it seems like you are missing an argument when defining the widget’s via your theme. You will need all 4 key => value pairs defined by the Hooks page you cited 🙂

    Just in case, check your spelling as well! The four keys you need are title, id,description, and slug.

    Everything is definitely doable! 😉 We’ll get this sorted out in no time!

    While I have your attention, can I ask how you found ACFW? 🙂

    • This reply was modified 5 years, 7 months ago by Daron Spence.
    #2250
    Johannes Tiner
    Participant

    Quick respond, me like 🙂

    I found your YT video when googeling after i found out that ACF pro could add fields in widgets wich i didn’t know 😛

    When using it as a plugin it works except for it is outputting a string’URL_TO_WIDGET-FILE.PHP’.. not sure im doing something wrong, don’t think i am tho.

    Anyway, still can’t get this to work haha, i feel so dumb 😛

    if i understand this correctly you are creating your widget in this code instead of doing it in the UI :

    add_filter('acfw_include_widgets', 'add_include_widgets');
    function add_include_widgets(){
    	$acfw_widgets = array(
    		array(
    			'title' => 'Test Widget 1',
    			'description' => 'A widget test from functions.php',
    			'slug' => 'test-widget',
    			'id' => 'Test_Widget',
    		),
    		array(
    			'title' => 'Test Widget 2',
    			'description' => 'A second widget test from functions.php',
    			'slug' => 'test-widget-2',
    			'id' => 'Test_Widget2',
    		),
    	);
    	return $acfw_widgets;
    }

    do i need to change anything else?

    And then i have this code to guide wp to the correct folder:

    include_once( get_stylesheet_directory() . '/acfw/acf-widgets.php' ); 
    // Enable include mode 
    add_filter('acfw_include', '__return_true');
    
    // Filter for ACFW include directory. Reletive to the theme root. Necessary for include mode.
    add_filter('acfw_dir', 'acfw_directory');
    function acfw_directory( $dir ){
    	// default value is /acf-widgets/
    	return '/acfw/';
    }
    #2251
    Daron Spence
    Keymaster

    Hey! Sorry, no super awesome reply time for this one 🙁

    I just realized what your first message meant about the 503. I was doing some plugin updates on the site, so you might try to download it again from http://acfwidgets.com/checkout/purchase-history/

    So I just realized i left a var_dump in the beta (github) repo. Might try to download it again if that was the version you were using. Unexpected output definitely would be a problem!

    If it isn’t working in include mode after downloading the new version, I would turn on error reporting to see if you can find an include error.

    Sorry you’re having so much trouble! If we don’t figure it out, I’d be happy to hop on a video chat and troubleshoot it with you! 🙂

    Let me know!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Some basic questions’ is closed to new replies.