Support

Account

Home Forums General Issues Custom Single Post Template

Solving

Custom Single Post Template

  • Hi

    Is it possible to create a single WordPress post template using ACF?

    I really hope so. As my client is struggling to keep all blog posts looking the same.

    Many Thanks

  • Not really, ACF is for custom fields!

  • Yes it is, would be good if you could select a template for posts as you can for pages.

    Thanks Elliott!!!!!!

  • Well you can do such thing
    single.php :

    <?php
      $single_type = get_field("single_type");
      
      if( $single_type == 'type1' ) {
        get_template_part("type1");
      } else {
        get_template_part("type2");
      }
    ?>

    You should create type1.php and type2.php files in your theme directory.
    I hope it is what you want to create.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Custom Single Post Template’ is closed to new replies.