@php
  $args = [
      'post_parent' => $post->ID,
      'post_type' => 'product',
  ];
  $children = get_children($args);
@endphp

@extends('layouts.app')

@if ($children)
  @section('content')
    @while (have_posts())
      @php the_post() @endphp
      @include('partials.page-header')
      <div class="container">
        <div class="post-content-wrapper">
          {!! the_content() !!}
        </div>
      </div>
    @endwhile


    @while (have_posts())
      @php the_post() @endphp
    @endwhile
  @endsection
@else
  @section('content')
    @while (have_posts())
      @php the_post() @endphp
      @include('partials.content-single-' . get_post_type())
    @endwhile
  @endsection
@endif
