Home › Forums › General Issues › ACF and Widgets › Reply To: ACF and Widgets
I don’t know exactly what you want but here is what i think it is:
You can assign the custom forms to widgets, unfortunately it’s only possible on ACF5.
First step is creating your widget:
class CustomWidget extends WP_Widget {
function __construct() {
parent::__construct(
'custom_widget', // Base ID
__('CustomWidget', 'text_domain'), // Name
array( 'description' => __( 'Some CustomWidget', 'text_domain' ), )
);
}
}
// register Foo_Widget widget
function register_foo_widget() {
register_widget( 'CustomWidget' );
}
add_action( 'widgets_init', 'register_foo_widget' );
After that, on the menu go Custom Fields > Custom Fields > Your Field > At the Location tab (Rules) choose on the first select “Widget” after that select “is equal to” and the name of your widget, in this case: “CustomWidget”.
After that save your field, go to theme > widget and drag and drop your widget on the area that you want.
I’m sending 2 pictures, on of the configuration field, and the other is the widget panel.
Hope this helps you! =D
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.