How to extend Portfolio Section at Front Page

If you need to show more portfolio items at the Front Page then there is by default you should follow the steps below. for example you need to show 10 portfolio items at Portfolio Section of the Front Page:

  1. Download Child Theme depending on the version you own
  2. Open functions.php from child theme folder and add the code below
    add_filter ('mp_emmet_portfolio_posts_per_page', 'my_theme_portfolio_posts_per_page');
    function my_theme_portfolio_posts_per_page() {
    return 10;
    }
  3. Install Child theme to your WordPress and activate it.
  4. See the result
  5. In case you want to put them into 2 rows you should add the styles below to style.css file of the Child Theme:
    .portfolio-list .portfolio-box {
    width: 20%;
    }
    .portfolio-list .portfolio-box:nth-child(6n-1) {
    clear: none;
    }
    .portfolio-list .portfolio-box:nth-child(7n-1) {
    clear: both;
    }

2 Replies to “How to extend Portfolio Section at Front Page”

  1. Instead of trying to put them into 2 rows, what if I want to put them into 3 or 4 or 5? How would the code in step 5 be adjusted based on the amount of rows? for example 25 portfolio images in 5 rows?

    1. Hi,
      You can try to add the code to functions.php file of the child theme:

      add_filter ('mp_emmet_portfolio_posts_per_page', 'my_theme_portfolio_posts_per_page');
      function my_theme_portfolio_posts_per_page() {
      return 10;
      }

      and styles below to style.css file of the child theme:
      .portfolio-list .portfolio-box {
      width: 20%;
      }
      .portfolio-list .portfolio-box:nth-child(6n-1) {
      clear: none;
      }
      .portfolio-list .portfolio-box:nth-child(5n+1) {
      clear: both;
      }

Leave a Reply

Your email address will not be published. Required fields are marked *