Portfolio URL very long and includes 'gallery' twice

resolved (4 posts) (2 voices)

  1. Hi,

    I've having a confusing day getting to grips with Portfolios.

    I found the instructions difficult to follow - it details how to make a portfolio post, but doesn't actually say how to insert items (images) into the portfolio.

    I finally figured out how to do it like your demo page (insert a 'fancy_images' set into the Portfolio post itself) and now I have another problem, which makes me think that I may not have done it correctly.

    I created a 'gallery' page [myurl.com/gallery] , which lists the individual portfolios, but when I click to view the portfolio, the address becomes: http://www.myurl.com/portfolio/portfolio_name/gallery/gallery.

    This seems excessively cluttered, have I done something incorrectly?

    Posted 4 years ago #
  2. Elliott

    Hello mikecooter,

    To set an image to the portfolio post you would use the featured image option, http://mysitemyway.com/docs/index.php/Using_the_Portfolio#Setting_the_featured_image.

    The gallery variable that gets added to the permalink is for the breadcrumbs. We can take it off but your portfolio post breadcrumbs will not link back to your portfolio page.

    Posted 4 years ago #
  3. Thanks Elliott,

    I get how setting a featured image allows a 'summary' image to show up when listing multiple portfolios. My early confusion came when attempting to add further images to the portfolio (ie, content - not the featured image itself.). None of the supporting docs cover that.

    I've disabled breadcrumbs anyway, so yes - I would be interested to know how I can get rid of the extra /gallery/gallery at the end of the URL, please.

    Posted 4 years ago #
  4. Elliott

    Open up /wp-content/themes/[your_theme]/lib/shortcodes/15-portfolio.php and on lines 255 - 259 you should see this,

    if( $wp_rewrite->using_permalinks() ) :
    	$url = ( empty( $_custom_link[$id] ) ) ? home_url( '/' ) . 'portfolio/' . $post->post_name . '/gallery/' . $gallery_post . '/' : $_custom_link[$id];
    else :
    	$url = htmlspecialchars( add_query_arg( array( 'gallery' => $gallery_post ), get_permalink( $id )) );

    Change it to this,

    if( $wp_rewrite->using_permalinks() ) :
    	$url = ( empty( $_custom_link[$id] ) ) ? home_url( '/' ) . 'portfolio/' : $_custom_link[$id];
    else :
    	$url = htmlspecialchars( add_query_arg( array( 'gallery' => $gallery_post ), get_permalink( $id )) );
    Posted 4 years ago #


You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme