Skip to content

Instantly share code, notes, and snippets.

@braddalton
Created December 8, 2019 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save braddalton/a86eece4af53e21b5248af8eaf7b476b to your computer and use it in GitHub Desktop.
Save braddalton/a86eece4af53e21b5248af8eaf7b476b to your computer and use it in GitHub Desktop.
Display Posts In One Category On Front Page of Genesis
<?php
/**
* @author - Brad Dalton
* @link - https://wpsites.net/web-design/display-posts-in-one-category-on-front-page-of-genesis-theme/
* @description - This file adds a custom template which displays posts in Category I.D 007 only
*
* @author Brad Dalton
* @package Customizations
*/
/*
Template Name: Custom
*/
remove_action('genesis_loop', 'genesis_do_loop');
add_action('genesis_loop', 'wpsites_custom_loop');
function wpsites_custom_loop() {
$args = array ( 'cat' => 007, 'order' => 'ASC' );
genesis_custom_loop( $args );
}
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment