• Resolved cexpert

    (@cexpert)


    I am trying to add the display of an APL at the end of the header using the et_before_main_content action hook provided by Divi theme.

    so I added the following

    if( !function_exists('post_grid_in_header') ) {
    function post_grid_in_header() {
    if (method_exists($advanced_post_list, "display_post_list")){echo $advanced_post_list->display_post_list("top_4_features_row");
    }
    }
    add_action( 'et_before_main_content', 'post_grid_in_header' );
    }

    in the theme child’s function.php file.

    As result I get: Undefined variable: advanced_post_list

    Please advise.

Viewing 1 replies (of 1 total)
  • Plugin Support Advanced Post List

    (@advancedpostlist)

    An update recently made $advanced_post_list into a global to resolve issues like this.

    If you replace the code with this, should resolve the issue.

    if( !function_exists('post_grid_in_header') ) {
    	function post_grid_in_header() {
    		global $advanced_post_list;
    		if (method_exists($advanced_post_list, "display_post_list")) {
    			echo $advanced_post_list->display_post_list("top_4_features_row");
    		}
    	}
    	add_action( 'et_before_main_content', 'post_grid_in_header' );
    }
    • This reply was modified 6 years, 6 months ago by Advanced Post List. Reason: comma missing
Viewing 1 replies (of 1 total)
  • The topic ‘Undefined variable: advanced_post_list’ is closed to new replies.