Home Forums General Issues Selection option used in header Reply To: Selection option used in header

  • Sure, no problem! Ok, since we’re outside the loop, first you just want to grab the global query that is being passed to your template files and assign the post data to a variable.

    Then you just add the post ID as a second parameter to get_field(). Here’s what it should look like:

    global $wp_query;  
    $post = $wp_query->post;
    <?php if (get_field('options_posts', $post->ID) == "para_1") {
        echo '<link rel="stylesheet" id="parallax-css"  href="#" type="text/css" media="all" />' ;
    } else if (get_field('options_posts', $post->ID) == "para_2") {
        echo '<link rel="stylesheet" id="parallax2-css"  href="#" type="text/css" media="all" />' ;
          } ?>

    That should take care of it for you, but if you have any trouble, let me know.