Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1259658

    Hi there,

    As always, thanks in advance for creating such a great theme and providing support on things like this.

    I have been using this post and this post as a guide to rename the Portfolio to something more suitable for my implementation.

    I am running up against the following errors when using it exactly:

    Notice: Undefined variable: permalinks in /home/tambellini/nw.tambellini.ca/wp-content/themes/enfold-child/functions.php on line 192

    Notice: Trying to access array offset on value of type null in /home/tambellini/nw.tambellini.ca/wp-content/themes/enfold-child/functions.php on line 192

    Notice: Undefined variable: permalinks in /home/tambellini/nw.tambellini.ca/wp-content/themes/enfold-child/functions.php on line 192

    Notice: Trying to access array offset on value of type null in /home/tambellini/nw.tambellini.ca/wp-content/themes/enfold-child/functions.php on line 192

    Warning: Cannot modify header information – headers already sent by (output started at /home/tambellini/nw.tambellini.ca/wp-content/themes/enfold-child/functions.php:192) in /home/tambellini/nw.tambellini.ca/wp-includes/functions.php on line 6274

    Warning: Cannot modify header information – headers already sent by (output started at /home/tambellini/nw.tambellini.ca/wp-content/themes/enfold-child/functions.php:192) in /home/tambellini/nw.tambellini.ca/wp-admin/includes/misc.php on line 1310

    Warning: Cannot modify header information – headers already sent by (output started at /home/tambellini/nw.tambellini.ca/wp-content/themes/enfold-child/functions.php:192) in /home/tambellini/nw.tambellini.ca/wp-admin/admin-header.php on line 9

    The code that seems to be causing the issue is below in the rewite (line 192):

    	$tax_args = array(
    		"hierarchical" => true,
    		"label" => "Portfolio Categories",
    		"singular_label" => "Portfolio Category",
    		"rewrite" => array('slug'=>_x($permalinks['portfolio_entries_taxonomy_base'],'URL slug','avia_framework'), 'with_front'=>true),
    		"query_var" => true
    	);

    For now, I have commented out the rewrite line because I need to work on other things without seeing those errors…

    Is there a different way to write the “rewrite” line? Or is it even necessary?

    #1260213
    This reply has been marked as private.
    #1260882

    Hi,

    Thank you for the inquiry.

    In the snippet or the filter, please look for the following line of code.

    add_filter('avf_portfolio_cpt_args', 'avf_portfolio_cpt_args_mod', 50, 1);
    
    

    Below, add this code to properly define or get the value of the $permalinks variable.

    $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'];
    

    You might have to adjust the default value of the portfolio_permalink_base and portfolio_entries_taxonomy_base based on the new value of the taxonomy or post type.

    Best regards,
    Ismael

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