Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #471

    Hi,

    in cleancut the portfolio items had a permalink without the “kategorie” in the URL, in Avisio there is “kategorie” added to the URL.

    How can I remove this unnecessary part as the URL already contains the “portfolio” part.

    So in cleancut the URL looks like:

    http://www.domain.at/portfolio/slug

    in avisio there is the category-base added:

    http://www.domain.at/category-base/portfolio/slug

    Do you have a quick fix for that?

    Br, Andreas

    #31523

    This question was asked some time ago. Have a look at this thread: http://www.kriesi.at/support/topic/permalinks#post-703

    The Dude

    #31524

    Open up /theme_options/portfolio.php and change this:

    $slugRule = get_option('category_base');
    if($slugRule == "") $slugRule = 'category';

    $args = array(
    'labels' => $labels,
    'public' => true,
    'show_ui' => true,
    'capability_type' => 'post',
    'hierarchical' => false,
    'rewrite' => array('slug'=>$slugRule.'/portfolio','with_front'=>true),
    'query_var' => true,
    'show_in_nav_menus'=> false,
    'menu_position' => 5,
    'supports' => array('title','thumbnail','excerpt','editor','comments')
    );

    to this:

    //$slugRule = get_option('category_base');
    //if($slugRule == "") $slugRule = 'category';
    $slugRule ="";

    $args = array(
    'labels' => $labels,
    'public' => true,
    'show_ui' => true,
    'capability_type' => 'post',
    'hierarchical' => false,
    'rewrite' => array('slug'=>$slugRule.'/portfolio','with_front'=>true),
    'query_var' => true,
    'show_in_nav_menus'=> false,
    'menu_position' => 5,
    'supports' => array('title','thumbnail','excerpt','editor','comments')
    );

    The no category base plugin doesn’t work on Portfolio pages because the code to register the post type added “category” back if it was removed.

    ** Edit **

    If you get 404 Page Not Found errors after completing these steps, see this post http://www.kriesi.at/support/topic/permalink-without-kategorie?#post-1748

    #31525

    I tried your code on my Website and it gives me a 404 error. But I’m not sure why because the permalinks in the admin panel and the links which show up in the browser url bar are identcal. I can’t preview the site from my admin panel, too (404 error).

    The Dude

    #31526

    Ok, edit. Now it works. I don’t know why it didn’t before, but it’s ok now.

    The Dude

    #31527

    Thanks, but I changed the code as detailed above but get a 404 like Dude.

    What do I have to do to make this work with an exisiting WP-installation as editing the entries magic as written by Dude does not help in my case.

    My steps:

    1. changed code

    2. uploaded code

    3. checked new URL – result: 404

    4. checked in other browser (cache ) – result: 404

    5. checked old url with kategorie – result: OK

    6. edited existing entry and published, checked new URL – result 404

    7. created new entry, checked new URL (which btw is shown in the editor) – result: 404

    I changed the code back as my entries would be offline otherwise. Any suggestions?

    #31528

    Try to combine the plugin “No category base” http://wordpress.org/extend/plugins/wp-no-category-base/ with James modification. So I solved my problem.

    So I played around with the plugin and afterwards everything worked perfect. The curious thing is that I have deactivated the plugin now and still everything is working…

    The Dude

    #31529

    If you find you’re getting 404 Page Not Found errors after completing my modification code, you need to flush your rewrite rules.

    To do this, you need to load (but not change or save) you Permalinks settings page (WP Admin -> Settings -> Permalinks).

    If anyone has problems with 404 Page Not Found errors after flushing the rules, let me know.

    @Dude The No Category Base plugin doesn’t affect the Portfolio URL’s because the structure of the URL is defined in /theme_options/portfolio.php and my modification excludes the category base.

    #31530

    Thanks, James – flushing worked.

    Never heard of that – learned something useful (again).

    Great support – thanks!

    #31531

    Hey!

    Cool glad it works for you.

    Regards,

    James

    #31532

    I reply here too.. I’ve got problem with it! And i loaded and saved and changed and loaded and saved the permalink-page (sooorry..)

    Please, need help right now!

    #31533

    Hey,

    As I said previously:

    If you find you’re getting 404 Page Not Found errors after completing my modification code, you need to flush your rewrite rules.

    To do this, you need to load (but not change or save) you Permalinks settings page (WP Admin -> Settings -> Permalinks).

    After going to your Permalink page are you still getting errors?

    James

    #31534

    Hi I’m having the same issue. I changed the php file using the new code, added the WP “no category” plug in (although I know it has no impact), flushed the permalink, rewrite page, emptied my cache, tried on different browsers…still getting 404 error. URGENT, please help.

    http://www.picturiapress.com

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

The topic ‘Permalink without "kategorie"’ is closed to new replies.