• Working on this site: http://johnoseadna.com/

    Self-hosted WordPress install, most current WP version, theme is a child of Blask.

    Right now I’ve got the non-shortcode JP Portfolio showing on the fixed front page, which gets the portfolio content and formatting via portfolio-page.php.

    I’ve got secondary pages set up to sort-of filter my work into categories that correspond to Portfolio project types (Design and Illustration in this case) and I’ve used shortcodes to display the projects on those pages:

    http://johnoseadna.com/design/ and http://johnoseadna.com/illustration/

    What I’d like to do is create modified duplicates of portfolio-page.php named, say, portfolio-page-design.php and portfolio-page-illo.php, and tweak the code so that it only displays projects with the appropriate type. (I found a support thread on that somewhere but can’t seem to locate it again. It was somewhat helpful but didn’t actually provide a solution.)

    The goal is to have a consistent look for all of the portfolio categories on the site, which is a pretty standard need for most artists and designers.

    I found a thread asking about this a year ago which gives a GitHub link, but the GH link is for shortcodes, not the main portfolio itself. This isn’t helpful, really.

    I know I can just give up on portfolio-page.php, but I much prefer the way it handles the display of projects. I just want some of the same controls as in a shortcode!

    I’ve tried the changes below in a file named portfolio-page-design.php and it returns a “no results found, would you like to search?” message rather than any projects. (The rest of the file is identical to portfolio-page.php, and in the right place in my folder structure; it just doesn’t return results.)

    <?php
    				if ( get_query_var( 'paged' ) ) :
    					$paged = get_query_var( 'paged' );
    				elseif ( get_query_var( 'page' ) ) :
    					$paged = get_query_var( 'page' );
    				else :
    					$paged = 1;
    				endif;
    
    				$posts_per_page = get_option( 'jetpack_portfolio_posts_per_page', '10' );
    				$args = array(
    					'post_type'      => 'jetpack-portfolio-design',
    					'nopaging'		 => 'true',
    					'posts_per_page' => $posts_per_page,
    					'paged'          => $paged,
    					'order'			 => 'rand',
    				);
    				$project_query = new WP_Query( $args );
    				if ( post_type_exists( 'jetpack-portfolio' ) && $project_query -> have_posts() ) :
    			?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter John O'Seadna

    (@oseadna)

    Sorry, forgot: I also tried this, but it didn’t work either.

    'post_type' => 'jetpack-portfolio-type-design',

    Thread Starter John O'Seadna

    (@oseadna)

    What’d I’d like to end up with is:

    • Projects within a specific project type
    • Sorted randomly
    • Preferably with infinite scroll rather than pagination

    Thanks!

    Did you ever sort this? I’m trying to do the same…

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Customizing Jetpack Portfolio default, NOT shortcodes’ is closed to new replies.