Community Forums › Forums › Archived Forums › Design Tips and Tricks › Executive Theme – How to maintain current marker on portfolio items
Tagged: portfolio
- This topic has 4 replies, 3 voices, and was last updated 11 years, 10 months ago by MakeYourselfVisible.
-
AuthorPosts
-
November 21, 2012 at 3:25 am #1080nightingaleMember
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
January 19, 2013 at 10:23 pm #13220DanParticipantHey 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
February 6, 2013 at 6:43 pm #18558MakeYourselfVisibleParticipantI 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":
Dan, thanks for the fix!
February 7, 2013 at 5:56 pm #18788DanParticipantGlad to have helped!
February 7, 2013 at 6:12 pm #18795MakeYourselfVisibleParticipantalso 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?
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.