To customise the Genesis loop on the blog page only, the blog page can be conditionally selected,  the loop removed on that page only and a custom loop inserted.

The blog page is selected with is_home, the genesis_do_loop is removed and a new loop wpb_change_home_loop is inserted.

The core markup for the genesis_do_loop is found in the framework at /lib/structure/loops.php line 75 genesis_standard_loop, so here you can adjust what is needed to output.

In the example above the excerpt is removed genesis_entry_content, but re-added with the_excerpt_max_charlength which refers to a separate function below the loop function to alter the character count of the excerpt – set to 200 in the example, also since the featured image is removed by genesis_entry_content this is also added back in with genesis_do_post_image.

5 Comments

  1. Mansoorkhan TK on April 28, 2018 at 10:06 am

    Thank you.

  2. Paul Lacey on September 23, 2016 at 11:28 pm

    Thanks man… This is the explanation that has really helped me. Now almost anything seems possible.

    This is a great tutorial for replacing basically any core Genesis function too.

    Cheers

    • Neil Gowran on September 24, 2016 at 6:44 am

      No worries, yes you can then basically custom code any loop you need.

  3. Emman The GreaT on April 12, 2016 at 7:44 am

    Thanks, it helps me alot…

  4. Duy nguyen on September 9, 2015 at 2:58 am

    Thank you! this is a very helpful article for me.

Leave a Comment