Viewing 25 posts - 1 through 25 (of 25 total)
  • Author
    Posts
  • #359082

    Can you advise on how to set up website so I have the following url structures for portfolio item and blog entries?

    mydonain.com/blog/news-item/

    mydomain.com/portfolio/portfolio-item/

    I have yoast seo installed, but unable to change the url structure of both news and portfolio items at the same time. I eaither end up with:

    mydonain.com/blog/news-item/ and mydomain.com/news/portfolio/portfolio-item/

    or

    mydonain.com/news-item/ and mydomain.com/news/portfolio/portfolio-item/

    Can you advise?

    Kind regards

    Duncan

    #359404

    Hey dweddell!

    Thank you for using Enfold.

    Try this structure on Settings > Permalink > Custom Structure field:

    /blog/%postname%
    

    Change the portfolio item url on the Portfolio Items Base field.

    Regards,
    Ismael

    #365669

    Hello,

    I am using this structure as my permalink. However, I would like /blog/ to be excluded from my portfolio item URL. Is there any change to the code that can be done to solve the problem I am facing:

    Blog post: http://www.optimusinfo.com/blog/optimus-information-breakfast-series-mobile-development-outsourcing/

    Portfolio item (Current): http://www.optimusinfo.com/blog/case-study/test-scenarios-for-credit-card-payment-through-a-pos-application/

    Portfolio item (Requested): http://www.optimusinfo.com/case-study/test-scenarios-for-credit-card-payment-through-a-pos-application/

    Thanks,
    Jason

    #365808

    Hey!

    I tested this on my installation and it is really a problem when it comes to portfolio items. Not sure how we can amend this. I’ll ask the rest of the support team if they have any idea.

    Regards,
    Ismael

    #367057

    Hi!

    Try opening up /enfold/includes/admin/register-portfolio.php and change line 34 from this.

    'rewrite' => array('slug'=>_x($permalinks['portfolio_permalink_base'],'URL slug','avia_framework'), 'with_front'=>true),
    

    To this.

    'rewrite' => array('slug'=>_x($permalinks['portfolio_permalink_base'],'URL slug','avia_framework'), 'with_front'=>false),
    

    Cheers!
    Elliott

    #367097

    Thanks, but that did not work. It removed /blog/ from the portfolio item URL in the portfolio. However, when I clicked to view the item it took me to http://www.optimusinfo.com/case-study/test-scenarios-for-credit-card-payment-through-a-pos-application/ and displayed a 404 error. The URL of the individual portfolio items did not change. They were still: http://www.optimusinfo.com/blog/case-study/test-scenarios-for-credit-card-payment-through-a-pos-application/

    Any idea how to change the URL of the portfolio items as well?

    Thanks
    Jason

    #367426

    Hi!

    Sorry, I forgot to tell you to refresh your permalinks in Dashboard > Settings > Permalinks after doing the edit.

    Cheers!
    Elliott

    • This reply was modified 9 years, 11 months ago by Elliott.
    #367561

    Fantastic, that worked!

    I am worried I will lose this change whenever I update the theme. Can this be added to a child theme? If so, is there an Enfold child theme that I can install and apply the change there. If so, please share instructions.

    Thanks again

    #367581

    Hey!

    See here for downloading our Enfold child theme, http://kriesi.at/documentation/enfold/downloads/.

    Add this to the bottom of your child theme functions.php file.

    
    add_action('init', 'portfolio_register_extended', 999 );
    function portfolio_register_extended()
    {
    	global $avia_config;
     
    	$labels = array(
    		'name' => _x('Portfolio Items', 'post type general name','avia_framework'),
    		'singular_name' => _x('Portfolio Entry', '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' => ''
    	);
     
        $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'];
     
    	$args = array(
    		'labels' => $labels,
    		'public' => true,
    		'show_ui' => true,
    		'capability_type' => 'post',
    		'hierarchical' => false,
    		'rewrite' => array('slug'=>_x($permalinks['portfolio_permalink_base'],'URL slug','avia_framework'), 'with_front'=>false),
    		'query_var' => true,
    		'show_in_nav_menus'=> true,
    		'taxonomies' => array('post_tag'),
    		'supports' => array('title','thumbnail','excerpt','editor','comments')
    	);
    	
    	
    	$args = apply_filters('avf_portfolio_cpt_args', $args);
    	$avia_config['custom_post']['portfolio']['args'] = $args;
     
    	register_post_type( 'portfolio' , $args );
    
    	$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
    	);
     
     	$avia_config['custom_taxonomy']['portfolio']['portfolio_entries']['args'] = $tax_args;
    
    	register_taxonomy("portfolio_entries", array("portfolio"), $tax_args);
    
    	//deactivate the avia_flush_rewrites() function - not required because we rely on the default wordpress permalink settings
    	remove_action('wp_loaded', 'avia_flush_rewrites');
    }

    Regards,
    Elliott

    • This reply was modified 9 years, 11 months ago by Elliott.
    #370852

    Hi,

    When I activated the child theme it took me to the “Enfold Theme Options” page. None of my old settings were there. When I activate the child theme do I have to re-enter all of my theme settings again?

    Thanks,
    Jason

    #370920

    Hey!

    After you activate the child theme, go to Enfold > Import/Export panel. Click Import Parent Theme Settings. Please create a backup of the database before doing this, just in case.

    Cheers!
    Ismael

    #457601

    Hi there,

    i have the similar problem. My custom URL structure for posts is /blog/%postname%/

    However, for blog i want to have /tv/%postname%/

    could you please advise if there is now a way to remove ‘blog’ from the portfolio structure without editing any source files?

    #457646

    Hi!

    Please try the following

    <?php
    add_action('init', 'portfolio_register_extended', 999 );
    function portfolio_register_extended()
    {
    	global $avia_config;
     
    	$labels = array(
    		'name' => _x('Portfolio Items', 'post type general name','avia_framework'),
    		'singular_name' => _x('Portfolio Entry', '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'),
            'rewrite'  => array(
    					'slug'		 	=> 'tv',
    					'with_front'	=> true
    				),
    		'parent_item_colon' => ''
    	);
     
        $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'];
     
    	$args = array(
    		'labels' => $labels,
    		'public' => true,
    		'show_ui' => true,
    		'capability_type' => 'post',
    		'hierarchical' => false,
    		'rewrite' => array('slug'=>_x($permalinks['portfolio_permalink_base'],'URL slug','avia_framework'), 'with_front'=>true),
    		'query_var' => true,
    		'show_in_nav_menus'=> true,
    		'taxonomies' => array('post_tag'),
    		'supports' => array('title','thumbnail','excerpt','editor','comments')
    	);
    	
    	
    	$args = apply_filters('avf_portfolio_cpt_args', $args);
    	$avia_config['custom_post']['portfolio']['args'] = $args;
     
    	register_post_type( 'portfolio' , $args );
    
    	$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
    	);
     
     	$avia_config['custom_taxonomy']['portfolio']['portfolio_entries']['args'] = $tax_args;
    
    	register_taxonomy("portfolio_entries", array("portfolio"), $tax_args);
    
    	//deactivate the avia_flush_rewrites() function - not required because we rely on the default wordpress permalink settings
    	remove_action('wp_loaded', 'avia_flush_rewrites')

    Best regards,
    Basilis

    #457771

    Hi Basilis,

    probably you did not see my complete ticket request in a hurry. As i mentioned……

    Could you please advise if there is now a way to remove ‘blog’ from the portfolio structure without editing any source

    I really do not want to edit something that will break with updates.

    Regards,
    Hiren

    #457989

    Hey!

    You can add this in the child theme’s functions.php file:

    add_filter('avf_portfolio_cpt_args', 'avf_portfolio_cpt_args_mod');
    function avf_portfolio_cpt_args_mod($args) {
    	$args['rewrite']['with_front'] = false;
    	return $args;
    }

    Flush the permalink settings after.

    Regards,
    Ismael

    #463123

    How about just adding this functionality to the enfold theme by default?

    There shouldn’t be a need to go into a functions file to fix this. Other plugins and custom post types operate this way. WooCommerce is a good example. We don’t have mysite.com/blog/shop/product-page do we?

    #463390

    Hey!

    Most users want the portfolio permalinks to use the structure they have set in Dashboard > Settings > Permalinks which is why we do not do it by default.

    Best regards,
    Elliott

    #571711

    Hi

    Did this request ever get added to the default functionality.

    I too do not want to edit the functions file.

    I would like my portfolio items to have the URL structure http://www.mydomain.com/portfolio/portfolio-item-name

    and my blog posts to have http://www.mydomain.com/blog/blog-post-name

    Currently my portfolio items are http://www.mydomain.com/blog/portfolio/portfolio-item-name

    Thanks a million.

    #572832

    Hey!

    make your adjustments in Dashboard > Settings > Permalinks a Elliott already mentioned.

    Feel free to make a feature request for Kriesi here: kriesi.at/support/enfold-feature-requests/

    Gruß,
    Andy

    #580509

    I keep changing my permalink to be /%postname%/ and when I go to save it it keeps going back to http://myonation.com/sample-post/. Can you help me fix this?

    #582072

    Hi!

    That is the same permalink structure. https://codex.wordpress.org/Using_Permalinks#Choosing_your_permalink_structure

    Cheers!
    Ismael

    #934266

    Hello, I’m having same issue in 2018.

    I had /blog/ added to my permalinks, however /blog/ was also added automatically to portfolio items. I would like my blog to be:
    https://www.coma.lv/blog/2018/02/21/kak-blokchejn-mozhet-izmenit-rynok-frilansa/
    and portfolio structure:

    https://www.coma.lv/our-projects/shops/nonpareil/
    and each page must be working – Our Projects, Shops

    Currently I have

    • This reply was modified 6 years, 8 months ago by vadikcoma.
    #934762

    Hi,


    @vadikcoma
    : This thread may help.

    // https://kriesi.at/support/topic/url-structure-for-portfolio-items/#post-835251

    The “with_front” parameter of the portfolio custom post type is set to true by default.

    Best regards,
    Ismael

    #935339

    Didn’t worked at all unfortunately :-(

    #935853

    Hi,

    Did you refresh the permalinks? Please create a new ticket or thread with the site url and login credentials. We’ll check it there.

    Best regards,
    Ismael

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