Support » Developing with WordPress » Get custom fields

  • Resolved Cezar Ayran

    (@ayrancd)


    I have Avada theme installed and they have a new feature called Avada Slide. I can get what I want since they use a custom post type… I’d like to know if there is any way to get the custom fields they added… like each slide has: heading area, color, title size, caption area etc… I can see the name of the field if I inspect it but how do I get the value using PHP/WP functions?

    For example these are some field names when I inspect:

    _fusion[caption]
    _fusion[heading_font_size]
    _fusion[heading]
    ….

    • This topic was modified 3 months, 2 weeks ago by Cezar Ayran.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    Because you’re using a commercial theme, please use their official support channel. We feel they are best equipped to support their products.

    https://theme-fusion.com/documentation/avada/support/avada-theme-support/

    Commercial products are not supported in these forums.

    Thread Starter Cezar Ayran

    (@ayrancd)

    uhh they don’t really help with that.

    Thread Starter Cezar Ayran

    (@ayrancd)

    I just got a response from Avada and want to share with you guys:

    $slide_id = 100; //change with your own slide id
    	$metadata = wp_parse_args(
    					fusion_data()->post_meta( $slide_id )->get_all_meta(),
    					[
    						'type'                => 'image',
    						'aspect_ratio'        => '16:9',
    						'youtube_id'          => '',
    						'vimeo_id'            => '',
    						'mp4'                 => '',
    						'webm'                => '',
    						'ogv'                 => '',
    						'preview_image'       => '',
    						'video_display'       => 'cover',
    						'video_bg_color'      => '',
    						'mute_video'          => 'no',
    						'autoplay_video'      => 'no',
    						'loop_video'          => 'no',
    						'hide_video_controls' => 'yes',
    						'content_alignment'   => 'center',
    						'heading'             => '',
    						'heading_separator'   => 'none',
    						'heading_size'        => 2,
    						'heading_font_size'   => '',
    						'heading_color'       => '',
    						'heading_bg'          => 'yes',
    						'heading_bg_color'    => '',
    						'caption'             => '',
    						'caption_separator'   => 'none',
    						'caption_size'        => 3,
    						'caption_font_size'   => '',
    						'caption_color'       => '',
    						'caption_bg'          => 'yes',
    						'caption_bg_color'    => '',
    						'link_type'           => 'button',
    						'slide_link'          => '',
    						'slide_target'        => 'yes',
    						'button_1'            => '',
    						'button_2'            => '',
    					]
    				);
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.