Support

Account

Home Forums Add-ons Gallery Field Creating separate page for ACF-Gallery field Reply To: Creating separate page for ACF-Gallery field

  • just to get sure:
    you have a working single-performance.php, that print out everything you need.
    you have a working page-gallery.php with featured image and title that link for now to single-performance.php?
    and you wish a link to single-performance.php that only shows the gallery?

    if yes, i think this will be the easiest way to solve that would be:

    inside page-gallery.php something like that instead of permalink only
    add_query_arg( 'gallery_only', 'yes', get_permalink() );

    inside your plugin or functions.php add it to the public query variables

    function add_custom_query_var( $vars ){
      $vars[] = "gallery_only";
      return $vars;
    }
    add_filter( 'query_vars', 'add_custom_query_var' );

    inside single-performance.php get value that you pass when it come from page-gallery.php
    $my_gallery_only = get_query_var( 'gallery_only' );

    use after that if ($my_gallery_only == 'yes')
    to switch between your normal-all and gallery-only view

    hope that this is what you need and that it works for you