URL for portfolio posts
  • How can I change the wording you chose for the portfolio URL from /portfolio-post/ to something else?
  • mikemike
    July 2012
    You can update this here:

    functions.php


    // Register custom post types
    add_action('init', 'pyre_init');
    function pyre_init() {
    register_post_type(
    'portfolio',
    array(
    'labels' => array(
    'name' => 'Portfolio',
    'singular_name' => 'Portfolio'
    ),
    'public' => true,
    'has_archive' => true,
    'rewrite' => array('slug' => 'portfolio-post'),
    'supports' => array('title', 'editor', 'thumbnail','comments'),
    'can_export' => true,
    )
    );

    // let's register taxonomies for portfolio custom posts
    //register_taxonomy('portfolio_category', 'portfolio', array('hierarchical' => true, 'label' => 'Categories', 'query_var' => true, 'rewrite' => true));
    register_taxonomy('portfolio_type', 'portfolio', array('hierarchical' => true, 'label' => 'Types', 'query_var' => true, 'rewrite' => true));
    }



    Look for this code to adjust it "portfolio-post" is the URL:
    'rewrite' => array('slug' => 'portfolio-post'),
  • Page not found if it's changed to anything else, any other places that it might need to be changed?
  • mikemike
    July 2012
    Nope, that's the only spot so it should be easy.

    Give your server some time to rebuild the pages (a few minutes). Then clear your cache and restart your computer if necessary. You likely cached the 404 page not found.
  • mikemike
    July 2012
    Feel free to post a link url and I'll double-check it to see if it's just a page cache issue.
  • mikemike
    July 2012
    Yeah it's a 404. Chances are it's just your hosting provider having issues updating the permalink. Check out some of these google searches in order to sort that out (Should be a easy fix):
    This one should work: http://wpengineer.com/2044/custom-post-type-and-permalink/

    http://www.google.com/search?client=safari&rls=en&q=custom+post+type+slug+rewrite&ie=UTF-8&oe=UTF-8
  • Thanks for that, all I needed to do was re-save the permalink settings.