-
AuthorPosts
-
August 27, 2021 at 6:57 am #1318584
Hello,
i updated to the latest Enfold version and it had a conflict with my child theme. Please see errors below. Appreciate your suggestion on how to fix the issues.
Thanks,
Nik
Notice: Undefined variable: permalinks in /home/abc232/public_html/example.com/wp-content/themes/enfold-child/functions.php on line 33
Warning: Cannot modify header information – headers already sent by (output started at /home/abc232/public_html/example.com/wp-content/themes/enfold-child/functions.php:33) in /home/abc232/public_html/example.com/wp-includes/functions.php on line 6584
Warning: Cannot modify header information – headers already sent by (output started at /home/abc232/public_html/example.com/wp-content/themes/enfold-child/functions.php:33) in /home/abc232/public_html/example.com/wp-content/themes/enfold/framework/php/function-set-avia-backend.php on line 744
Warning: Cannot modify header information – headers already sent by (output started at /home/abc232/public_html/example.com/wp-content/themes/enfold-child/functions.php:33) in /home/abc232/public_html/example.com/wp-admin/includes/misc.php on line 1310
Warning: Cannot modify header information – headers already sent by (output started at /home/abc232/public_html/example.com/wp-content/themes/enfold-child/functions.php:33) in /home/abc232/public_html/example.com/wp-admin/admin-header.php on line 9
BELOW IS THE CHILD THEME INFO. ON LINE 33
“singular_label” => “Features Category”, “rewrite” => array(‘slug’=>_x($permalinks[‘portfolio_entries_taxonomy_base’],’URL slug’,’avia_framework’), ‘with_front’=>true),
BELOW IS THE CHILD THEME INFO. FOR PORTFOLIO
// portfolio args add_action( 'init', 'init_reg_portfolio', 50 ); function init_reg_portfolio() { add_filter('avf_portfolio_cpt_args', 'avf_portfolio_cpt_args_mod', 50, 1); $tax_args = array( "hierarchical" => true, "label" => "Features Categories", "singular_label" => "Features Category", "rewrite" => array('slug'=>_x($permalinks['portfolio_entries_taxonomy_base'],'URL slug','avia_framework'), 'with_front'=>true), "query_var" => true ); $avia_config['custom_taxonomy']['portfolio']['portfolio_entries']['args'] = $tax_args; register_taxonomy("portfolio_entries", array("portfolio"), $tax_args); } add_action( 'after_setup_theme', 'init_reg_portfolio' ); function avf_portfolio_cpt_args_mod($args) { $labels = array( 'name' => _x('Features', 'post type general name','avia_framework'), 'singular_name' => _x('Features', 'post type singular name','avia_framework'), 'add_new' => _x('Add New', 'portfolio','avia_framework'), 'add_new_item' => __('Add New Portfolio Entry','avia_framework'), 'edit_item' => __('Edit Portfolio Entry','avia_framework'), 'new_item' => __('New Portfolio Entry','avia_framework'), 'view_item' => __('View Portfolio Entry','avia_framework'), 'search_items' => __('Search Portfolio Entries','avia_framework'), 'not_found' => __('No Portfolio Entries found','avia_framework'), 'not_found_in_trash' => __('No Portfolio Entries found in Trash','avia_framework'), 'parent_item_colon' => '' ); $args['labels'] = $labels; return $args; }
August 30, 2021 at 10:13 am #1318938Hey Nik,
Thank you for the inquiry.
Why did you override the portfolio registration in the child theme? The error occurs because this array or variable is not defined.
$permalinks[‘portfolio_entries_taxonomy_base’]
In the enfold/includes/admin/register-portfolio.php file, you will find this code around line 25.
$permalinks = get_option('avia_permalink_settings'); if(!$permalinks) $permalinks = array(); $permalinks['portfolio_permalink_base'] = empty($permalinks['portfolio_permalink_base']) ? __('portfolio-item', 'avia_framework') : $permalinks['portfolio_permalink_base']; $permalinks['portfolio_entries_taxonomy_base'] = empty($permalinks['portfolio_entries_taxonomy_base']) ? __('portfolio_entries', 'avia_framework') : $permalinks['portfolio_entries_taxonomy_base'];
Best regards,
IsmaelAugust 31, 2021 at 9:47 am #1319079Hello Ismael,
Thank you for getting back. Sorry, would you clarify what needs to be done. Are you suggesting that I remove the coding
$permalinks[‘portfolio_entries_taxonomy_base’]
AND REPLACE WITH
`$permalinks[‘portfolio_entries_taxonomy_base’] = empty($permalinks[‘portfolio_entries_taxonomy_base’]) ? __(‘portfolio_entries’, ‘avia_framework’) : $permalinks[‘portfolio_entries_taxonomy_base’];
`
——————————————
YOUR QUESTION: Why did you override the portfolio registration in the child theme? The error occurs because this array or variable is not defined.The coding was given to me by your team in 2018. See post
#993692.There was never an error with all the Enfold theme updates, except with the latest version.
Your help is much appreciated.
Nik
September 2, 2021 at 7:40 am #1319440Hi,
You have to include the code that we added above to assign a value to the $permalinks array. Place it within the init_reg_portfolio function, right after this line.
add_filter('avf_portfolio_cpt_args', 'avf_portfolio_cpt_args_mod', 50, 1);
Example:
add_filter('avf_portfolio_cpt_args', 'avf_portfolio_cpt_args_mod', 50, 1); $permalinks = get_option('avia_permalink_settings'); if(!$permalinks) $permalinks = array(); $permalinks['portfolio_permalink_base'] = empty($permalinks['portfolio_permalink_base']) ? __('portfolio-item', 'avia_framework') : $permalinks['portfolio_permalink_base']; $permalinks['portfolio_entries_taxonomy_base'] = empty($permalinks['portfolio_entries_taxonomy_base']) ? __('portfolio_entries', 'avia_framework') : $permalinks['portfolio_entries_taxonomy_base'];
Best regards,
IsmaelSeptember 5, 2021 at 9:23 am #1319779Hi Ismael,
Thank you very much for the coding. It works!
Cheers,
NikSeptember 6, 2021 at 6:28 am #1319835 -
AuthorPosts
- The topic ‘Enfold V4.8.6.2 causing errors to portfolio’ is closed to new replies.