Executive Theme – How to maintain current marker on portfolio items

Community Forums Forums Design Tips and Tricks Executive Theme – How to maintain current marker on portfolio items

This topic is: not resolved

Tagged: 

This topic contains 4 replies, has 3 voices, and was last updated by  MakeYourselfVisible 1 year, 6 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1080

    nightingale
    Participant

    I have used the executive theme for this website (http://www.belltruckservices.co.uk ).

    Does anyone know how to make each portfolio post item (see Our Fleet) to maintain the current marker on the parent menu item?

    Also, is it possible to change the url from belltruckservices.co.uk/portfolio to belltruckservices/our-fleet

    #13220

    Dan
    Participant
    Post count: 23

    Hey nightingale,
    I’ll have a stab at the URL change, I’m working on a site using Executive at the moment so I’ll see what I can do. In the child theme functions.php, you should see this block of code:

    /** Create portfolio custom post type */
    add_action( 'init', 'executive_portfolio_post_type' );
    function executive_portfolio_post_type() {
    register_post_type( 'portfolio',
    array(
    'labels' => array(
    'name' => __( 'Portfolio', 'executive' ),
    'singular_name' => __( 'Portfolio', 'executive' ),
    ),
    'exclude_from_search' => true,
    'has_archive' => true,
    'hierarchical' => true,
    'menu_icon' => get_stylesheet_directory_uri() . '/images/icons/portfolio.png',
    'public' => true,
    'rewrite' => array( 'slug' => 'portfolio' ),
    'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes', 'genesis-seo' ),
    )
    );
    }

    If all you have to work on is the ‘live’ site, give yourself a fall back and duplicate the code, rather than modifying it (which might break something). Substitute ‘portfolio’ for ‘our-fleet’:

    /** Create portfolio custom post type */
    add_action( ‘init’, ‘ourfleet_post_type’ );
    function ourfleet_post_type() {
    register_post_type( ‘ourfleet’,
    array(
    ‘labels’ => array(
    ‘name’ => __( ‘Our Fleet’, ‘executive’ ),
    ‘singular_name’ => __( ‘Our Fleet’, ‘executive’ ),
    ),
    ‘exclude_from_search’ => true,
    ‘has_archive’ => true,
    ‘hierarchical’ => true,
    ‘menu_icon’ => get_stylesheet_directory_uri() . ‘/images/icons/portfolio.png’,
    ‘public’ => true,
    ‘rewrite’ => array( ‘slug’ => ‘our-fleet’ ),
    ‘supports’ => array( ‘title’, ‘editor’, ‘author’, ‘thumbnail’, ‘excerpt’, ‘trackbacks’, ‘custom-fields’, ‘comments’, ‘revisions’, ‘page-attributes’, ‘genesis-seo’ ),
    )
    );
    }

    You'll need to re-save your permalinks once done, but that should add a second custom post type called 'Our Fleet'. Test it by duplicating a couple of the trucks you already have. If it's all working, duplicate the remaining posts across. (You may be able to find a change-post-type plugin that can help you here if there's too many)

    I would also recommend making a note of the old URLs and redirecting them to the new ones once you're done too - no point hobbling yourself with dead urls (if you remove the old /portfolio items) or duplicate content (if you don't) in the search engine race... Look for the 'Simple 301 Redirects' plugin if you're not up for getting your hands dirty in your .htaccess file.

    Of course, if any one has a better / more efficient method, I'll defer to greater minds!

    HTH

    #18558

    MakeYourselfVisible
    Participant
    Post count: 33

    I had the same question and was able to accomplish this using Dan’s advice and going through all the CSS/PHP files and changing all instances of “portfolio” to “projects” (in your case “Our_Fleet”) and refreshing permalinks.

    I also removed all styling relating to the portfolio and used the styling from this article (again replacing “portfolio” with “projects”:

    http://genesistweaks.com/adding-a-portfolio-custom-post-type/

    Dan, thanks for the fix!

    #18788

    Dan
    Participant
    Post count: 23

    Glad to have helped!

    #18795

    MakeYourselfVisible
    Participant
    Post count: 33

    also renamed single-portfolio.php and archive-portfolio.php and changing the image name pertaining to the portfolio. I’m not a developer expert but I suppose you could create many different portfolios by repeating the same process with different new titles, no?

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

You must be logged in to reply to this topic.