Support » Theme: Sketch » Number of thumbs on Portfolio Page template

  • I would like to change the number of thumbnail on my homepage (Portfolio Page template).

    Looks like the thumbs are inserted with this code in the template:

    	<div class="projects clear">
    <?php
    while ( $project_query -> have_posts() ) : $project_query -> the_post();
    get_template_part( 'content', 'portfolio' );
    endwhile;
    ?>
    </div>

    I believe it is possible to easily change the number of project thumbs. Currently, I show 6 projects. Iā€™m using a child theme and am happy to change the html and php code.

    Hopefully someone can help. Thank you very much.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi –

    Are you able to share the site URL with me here? To be clear, you only want to change the number of thumbnails shown on your portfolio page?

    Thanks for your reply.

    The website is not public yet, therefore ssharing the url wouldn’t help.

    Yes, I would like to change the number of project thumbnails on the homepage, which uses the Portfolio Page template. I would like to keep the three column layout, but would like to be able to show 3, 6, 9 or 12 thumbnails.

    I found this code in the page template:

    $posts_per_page = get_option( 'jetpack_portfolio_posts_per_page', '9' );

    but changing the ‘9’ didn’t help.

    You should be able to do that with the attributes of portfolio shortcode. Have you already tried that?

    https://en.support.wordpress.com/portfolios/portfolio-shortcode/

    Thanks!
    Yes of course, this would work.

    Just commented out the code responsible for showing the small project images in the portfolio-page template

    ` <div class=”projects clear”>
    <?php
    while ( $project_query -> have_posts() ) : $project_query -> the_post();
    get_template_part( ‘content’, ‘portfolio’ );
    endwhile;
    ?>
    </div>`

    In the wp backend, I then inserted the portfolio shortcode on the homepage.

    Was actually hoping to do it without shortcode, by changing the php code of the template.

    You may be able to achieve that through the php, but it’s more customization than we can support here in the forums.

    I understand. Thank you very much anyway. I might do it with shortcode.

    You’re welcome šŸ™‚ Take care and best wishes!

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.