Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Schalk Joubert

    (@schalkjoubert)

    hi Josh,

    I manage this with ACF, but still, is this the best way?
    And is it possible to simply add the export from my ACF in the slider file?

    I always try to limit the amount of plugins…

    This is my ACF export:

    if( function_exists('acf_add_local_field_group') ):
    
    acf_add_local_field_group(array (
    	'key' => 'group_574f304f73fe1',
    	'title' => 'Slide Description',
    	'fields' => array (
    		array (
    			'key' => 'field_574f30709b663',
    			'label' => 'slide description',
    			'name' => 'slide_description',
    			'type' => 'textarea',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array (
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'default_value' => '',
    			'placeholder' => '',
    			'maxlength' => 50,
    			'rows' => 3,
    			'new_lines' => 'wpautop',
    			'readonly' => 0,
    			'disabled' => 0,
    		),
    	),
    	'location' => array (
    		array (
    			array (
    				'param' => 'post_type',
    				'operator' => '==',
    				'value' => 'slide',
    			),
    		),
    	),
    	'menu_order' => 0,
    	'position' => 'normal',
    	'style' => 'default',
    	'label_placement' => 'top',
    	'instruction_placement' => 'label',
    	'hide_on_screen' => array (
    		0 => 'permalink',
    		1 => 'the_content',
    		2 => 'excerpt',
    		3 => 'custom_fields',
    		4 => 'discussion',
    		5 => 'comments',
    		6 => 'revisions',
    		7 => 'slug',
    		8 => 'author',
    		9 => 'format',
    		10 => 'page_attributes',
    		11 => 'categories',
    		12 => 'tags',
    		13 => 'send-trackbacks',
    	),
    	'active' => 1,
    	'description' => '',
    ));
    
    endif;
    Plugin Author Josh Leuze

    (@jleuze)

    This looks like a good setup to me. I often use ACF for this when I am also using ACF to add others fields to the site.

    When I’m not using ACF for anything else on a site I simplify it a bit though. For very basic captions I will use just the slide post title, like in the custom caption skin. If I need a headline and description for the captions, I will use the slide title for the headline, and add slide excerpts for the caption description.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom Field for Caption’ is closed to new replies.