• Skip to main content
  • Skip to primary sidebar

WordPress, Genesis Framework and Storefront customization tutorials

  • Free
  • Premium
  • Membership
    • Login
  • Design
  • Blog
  • About
  • Contact
Home » Custom single post template for specific category in Genesis

Custom single post template for specific category in Genesis

2020-03-11 by Gabor 2 Comments

Add this snippet to single.php

<?php
  
function custom_single_post() { 
        
        if(in_category('program')){
            include('single-CATEGORY_1.php');
        }elseif(in_category('piacter')){
            include('single-CATEGORY_2.php');    
        }else{
            include('single.php');
        }
   }
   add_action('genesis_before_loop', 'custom_single_post', 0);

genesis();

Filed Under: Free Tagged With: Genesis

Reader Interactions

Comments

  1. BrianSal says

    2020-03-30 at 16:35

    With thanks for sharing this well put together website.

    Reply
  2. Jameskanda says

    2020-04-28 at 06:55

    I love the details on your website. thnx.

    Reply

Leave a Reply Cancel reply

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

Primary Sidebar

  • Facebook
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter
  • YouTube
WP Rocket - WordPress Caching Plugin
UpdraftPlus Premium

Disclosure: Some of the links in this site are affiliate links. I will be paid a commission if you use this link to make a purchase.

  • Privacy Policy
  • Terms of Service
  • Flames Design
© 2021 WP Flames - All Right Reserved