Foodie Pro Archive Page Template With Columns

This template can be used in any genesis child theme. It has been tested on the Foodie Pro child theme by Shay Bocks in response to the following support request by a member of WP Sites:

Thank you for the simple and easily understood directions. I have this mostly implemented, but am not having my categories showing 4 columns; rather its only showing a full-sized featured image with linked title underneath.

Here’s what this 2nd solution produces:

grid-columns

  • The template only displays the featured image and title which you can position before or after the image.
  • You can add a excerpt as well if needed
  • You can also remove the sidebar so the columns display full width of the content sidebar wrap.
  • And you can use the template to display your entries in 2, 3, 4 or 6 columns

Here’s the code you can add to the template to display full width:

//* Force full width content layout
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' );

And here’s the full width result:

full-width

Examples of 2, 3 or 6 columns:

And here’s the code you can add to a new file in your child themes root directory. Name the file using the WordPress Template Hierarchy to control which archives its executed on. In this case, category.php.

Download template code for members:

Related Template Code


Comments

7 responses to “Foodie Pro Archive Page Template With Columns”

  1. Another question. Would it be hard to take this a step further? That is make it in to a two step solution? First page shows your subcategories. Example Bread, Pasta, Cookies and so on. And when you click on Bread you get the page you have in this tutorial?

    1. Brad Dalton Avatar
      Brad Dalton

      Can be done yes. Link to a live example please.

      You can use a solution like this to list sub categories and then load a template for sub categories using code like this :

      [code]
      add_filter( ‘category_template’, ‘load_subcategory_template’ );
      function load_subcategory_template( $template ) {

      $cat = get_queried_object();

      if ( 0 < $cat->category_parent )

      $template = locate_template( ‘sub-category.php’ );

      return $template;
      }
      [/code]

      1. I only have link to swedish cites but here is an example of what I mean.
        http://www.leila.se/leilas-recept/index1,5.htm

        1. Brad Dalton Avatar
          Brad Dalton

          Ok, see my previous answer which provides the code and link to several templates you can use.

          1. Thank’s

  2. This one was very nice. Would it be possible to set a number of how many post to show directly in the code? I know that as it is now it follows the number i write in settings, but it would be nice to set a larger number on a page like this.

    1. Brad Dalton Avatar
      Brad Dalton

      Hi Rita, yes, you can use code like this in functions with the correct conditional tag to target your template.

      [code]
      add_action(‘pre_get_posts’,’loop_filter’);
      function loop_filter($query) {

      if ( ! is_admin() && $query->is_main_query() && is_category() ) {

      $query->set( ‘orderby’, ‘date’ );
      $query->set( ‘order’, ‘ASC’ );
      $query->set( ‘posts_per_page’, 3 );
      }
      }
      [/code]

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.