In ProgressPortfolio slug on URL

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #23630
    ruben122
    Participant

    Hello,

    By default when you create a portfolio this path is showing –> portfolio/xxxx

    I translated (with loco translate) portfolio to a custom text, let’s say aaaa

    Now when I click on one of the single portfolio items it’s going to aaaa/xxxx, so it’s correct, but showing a 404 page.

    There is any change in the PHP files that need to be done also?

    Thanks.

    #23642
    Althemist
    Keymaster

    Hello ruben122,

    I am afraid changing the slug is not that easy and it can’t be done with just translation. You’d need some extensive PHP knowledge and change the function that register the custom post type slug.

    Here is a guide for one our themes. The principle is the same, you’d just need to adapt it for the Rigid theme:

    How to change portfolio permalink?

    Regards,
    Dimitar

    #23711
    ruben122
    Participant

    Hi Dimitar,

    Thanks for your answer.

    I followed and did the changes as mentioned on the link you shared, as a result I got the following code (below). Once I applied the code on the functions.php if I click on one of the single portfolio items it’s going to kosherplaces/xxxx, so the change is good, but it’s going to a 404 page.

    Any idea?

    Thanks in advance.

    remove_action(‘init’, ‘rigid_register_cpt_rigid_portfolio’, 5);
    add_action(‘init’, ‘rigid_child_register_cpt_rigid_portfolio’, 5);

    function rigid_child_register_cpt_rigid_portfolio() {

    $labels = array(
    ‘name’ => esc_html__(‘Portfolios’, ‘rigid-plugin’),
    ‘singular_name’ => esc_html__(‘Portfolio’, ‘rigid-plugin’),
    ‘add_new’ => esc_html__(‘Add New’, ‘rigid-plugin’),
    ‘add_new_item’ => esc_html__(‘Add New Portfolio’, ‘rigid-plugin’),
    ‘edit_item’ => esc_html__(‘Edit Portfolio’, ‘rigid-plugin’),
    ‘new_item’ => esc_html__(‘New Portfolio’, ‘rigid-plugin’),
    ‘view_item’ => esc_html__(‘View Portfolio’, ‘rigid-plugin’),
    ‘search_items’ => esc_html__(‘Search Portfolios’, ‘rigid-plugin’),
    ‘not_found’ => esc_html__(‘No portfolios found’, ‘rigid-plugin’),
    ‘not_found_in_trash’ => esc_html__(‘No portfolios found in Trash’, ‘rigid-plugin’),
    ‘parent_item_colon’ => esc_html__(‘Parent Portfolio:’, ‘rigid-plugin’),
    ‘menu_name’ => esc_html__(‘Portfolios’, ‘rigid-plugin’),
    );

    $args = array(
    ‘labels’ => $labels,
    ‘hierarchical’ => false,
    ‘description’ => ‘Rigid portfolio post type’,
    ‘supports’ => array(‘title’, ‘editor’, ‘excerpt’, ‘author’, ‘thumbnail’, ‘trackbacks’, ‘revisions’, ‘page-attributes’),
    ‘taxonomies’ => array(‘rigid_portfolio_category’),
    ‘public’ => true,
    ‘show_ui’ => true,
    ‘show_in_menu’ => true,
    ‘show_in_nav_menus’ => true,
    ‘publicly_queryable’ => true,
    ‘exclude_from_search’ => false,
    ‘has_archive’ => true,
    ‘query_var’ => true,
    ‘can_export’ => true,
    ‘rewrite’ => true,
    ‘capability_type’ => ‘page’,
    ‘menu_icon’ => ‘dashicons-portfolio’,
    ‘rewrite’ => array(
    ‘slug’ => esc_html__(‘kosherplaces’, ‘rigid-plugin’)
    )
    );

    register_post_type(‘rigid-portfolio’, $args);
    }

    #23834
    ruben122
    Participant

    Could someone from support just reply?

    #23995
    Althemist
    Keymaster

    Hi ruben122,

    So sorry for the late reply. I’ll ask our lead developer Alex to review your code and help if there is some error or if you missed something.

    Regards,
    Dimitar

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register