Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #712129

    I added the follow code to my child-theme functions php file so the AVIA would work with learn dash. it does for Courses, Lessons, and Topics. However, if I add a new Page, Avia does not show up. What do i need to add to the code to fix this?

    <?php

    /*
    * Add your own functions here. You can also copy some of the theme functions into this file.
    * WordPress will use those functions instead of the original functions then.
    */

    if(isset($avia_config[‘use_child_theme_functions_only’])) return;

    add_theme_support(‘avia_template_builder_custom_css’);

    /*
    add_filter(‘avf_logo_subtext’, ‘kriesi_logo_addition’);
    function kriesi_logo_addition($sub) {
    $sub .= “Company Name”;
    return $sub;
    }
    */

    //set builder mode to debug
    add_action(‘avia_builder_mode’, “builder_set_debug”);
    function builder_set_debug()
    {
    return “debug”;
    }

    add_theme_support(‘deactivate_layerslider’);

    add_theme_support( ‘avia_custom_shop_page’ );

    add_filter(‘avf_builder_boxes’, ‘avia_register_meta_boxes’, 10, 1); //Add meta boxes to custom post types
    function avia_register_meta_boxes($boxes)
    {
    if(!empty($boxes))
    {
    foreach($boxes as $key => $box)
    {
    $boxes[$key][‘page’][] = ‘sfwd-courses’;
    $boxes[$key][‘page’][] = ‘sfwd-lessons’;
    $boxes[$key][‘page’][] = ‘sfwd-topics’;
    $boxes[$key][‘page’][] = ‘sfwd-quiz’;
    }
    }
    return $boxes;
    }

    /*Controls look of gravity form fields */
    add_filter( ‘woocommerce_gforms_strip_meta_html’, ‘configure_woocommerce_gforms_strip_meta_html’ );
    function configure_woocommerce_gforms_strip_meta_html( $strip_html ) {
    $strip_html = false;
    return $strip_html;
    }

    /*removed image from product page*/
    remove_action( ‘woocommerce_before_single_product_summary’, ‘woocommerce_show_product_images’, 20 );

    add_filter(‘avf_builder_boxes’,’custom_post_types_options’);

    function custom_post_types_options($boxes)
    {
    $boxes[] = array( ‘title’ =>__(‘Avia Layout Builder’,’avia_framework’ ), ‘id’=>’avia_builder’, ‘page’=>array(‘sfwd-courses’, ‘sfwd-lessons’, ‘sfwd-topic’, ‘sfwd-quiz’), ‘context’=>’normal’, ‘expandable’=>true );
    $boxes[] = array( ‘title’ =>__(‘Layout’,’avia_framework’ ), ‘id’=>’layout’, ‘page’=>array(‘sfwd-courses’, ‘sfwd-lessons’, ‘sfwd-topic’, ‘sfwd-quiz’), ‘context’=>’side’, ‘priority’=>’low’);
    $boxes[] = array( ‘title’ =>__(‘Additional Portfolio Settings’,’avia_framework’ ), ‘id’=>’preview’, ‘page’=>array(‘sfwd-courses’, ‘sfwd-lessons’, ‘sfwd-topic’, ‘sfwd-quiz’), ‘context’=>’normal’, ‘priority’=>’high’ );

    return $boxes;
    }

    Thanks so much for the help.
    Ron

    #712728

    Hey ronmann,

    Thank you for using Enfold.

    Please replace the “avf_builder_boxes” filter with the following.

    add_filter('avf_builder_boxes', 'avf_builder_boxes_mod');
    
    function avf_builder_boxes_mod($metabox)
    {
    	foreach($metabox as &$meta)
    	{
    		if($meta['id'] == 'avia_builder' || $meta['id'] == 'layout')
    		{
    			$meta['page'][] = 'sfwd-lessons'; /*instead add the name of the custom post type here*/
                            $meta['page'][] = 'sfwd-courses';
                            $meta['page'][] = 'sfwd-quiz';
                            $meta['page'][] = 'sfwd-topic';
    		}
    	}
    
    	return $metabox;
    }

    Best regards,
    Ismael

    #712734

    Ismael,
    Thanks for getting back to me.

    Just to make sure…. I have two of these “add_filter” codes. Which one do you want me to replace?
    Ron

    Please see below:
    add_filter(‘avf_builder_boxes’, ‘avia_register_meta_boxes’, 10, 1); //Add meta boxes to custom post types
    function avia_register_meta_boxes($boxes)
    {
    if(!empty($boxes))
    {
    foreach($boxes as $key => $box)
    {
    $boxes[$key][‘page’][] = ‘sfwd-courses’;
    $boxes[$key][‘page’][] = ‘sfwd-lessons’;
    $boxes[$key][‘page’][] = ‘sfwd-topics’;
    $boxes[$key][‘page’][] = ‘sfwd-quiz’;
    }
    }
    return $boxes;
    }

    /*Controls look of gravity form fields */
    add_filter( ‘woocommerce_gforms_strip_meta_html’, ‘configure_woocommerce_gforms_strip_meta_html’ );
    function configure_woocommerce_gforms_strip_meta_html( $strip_html ) {
    $strip_html = false;
    return $strip_html;
    }

    /*removed image from product page*/
    remove_action( ‘woocommerce_before_single_product_summary’, ‘woocommerce_show_product_images’, 20 );

    add_filter(‘avf_builder_boxes’,’custom_post_types_options’);

    function custom_post_types_options($boxes)
    {
    $boxes[] = array( ‘title’ =>__(‘Avia Layout Builder’,’avia_framework’ ), ‘id’=>’avia_builder’, ‘page’=>array(‘sfwd-courses’, ‘sfwd-lessons’, ‘sfwd-topic’, ‘sfwd-quiz’), ‘context’=>’normal’, ‘expandable’=>true );
    $boxes[] = array( ‘title’ =>__(‘Layout’,’avia_framework’ ), ‘id’=>’layout’, ‘page’=>array(‘sfwd-courses’, ‘sfwd-lessons’, ‘sfwd-topic’, ‘sfwd-quiz’), ‘context’=>’side’, ‘priority’=>’low’);
    $boxes[] = array( ‘title’ =>__(‘Additional Portfolio Settings’,’avia_framework’ ), ‘id’=>’preview’, ‘page’=>array(‘sfwd-courses’, ‘sfwd-lessons’, ‘sfwd-topic’, ‘sfwd-quiz’), ‘context’=>’normal’, ‘priority’=>’high’ );

    return $boxes;
    }

    #713503

    Hey!

    It’s this code:

    add_filter(‘avf_builder_boxes’, ‘avia_register_meta_boxes’, 10, 1); //Add meta boxes to custom post types
    function avia_register_meta_boxes($boxes)
    {
    if(!empty($boxes))
    {
    foreach($boxes as $key => $box)
    {
    $boxes[$key][‘page’][] = ‘sfwd-courses’;
    $boxes[$key][‘page’][] = ‘sfwd-lessons’;
    $boxes[$key][‘page’][] = ‘sfwd-topics’;
    $boxes[$key][‘page’][] = ‘sfwd-quiz’;
    }
    }
    return $boxes;
    }

    Cheers!
    Nikko

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.