Hi I have a blog where the categories are news, events and inspiration. These categories are selected using radio buttons on acf. I want to load news on single-news.php while events on single-events.php and inspiration on single-inspiration.php
is it possible to use the acf fields to do this?
I have came across this code with wordpress default categories to load custom single.php s
<?php
$post = $wp_query->post;
if (in_category('1')) {
include(TEMPLATEPATH.'/single1.php');
} elseif (in_category('2')) {
include(TEMPLATEPATH.'/single2.php');
} else {
include(TEMPLATEPATH.'/single_default.php');
}
?>
what can be used instead of the ‘in_category’ while using acf?
thanks guys.
Hi,
you could use the following plugin
http://www.advancedcustomfields.com/add-ons/taxonomy-field/
to display on ACF a radio button with your 3 catégories, the post will get attached to the selectedi categorie, that way your code will still work.