Question: I need to run a function (show a modal) **if** a page **DOES** have a particular field value **AND is not** a certain page. It also needs to work if the page **DOES NOT HAVE THE FIELD VALUE** and it is not the certain page. They work individually like this:

//if page has field value:

```
<?php
    $values = get_field( 'recast_video' );
    if ( ($values) ) {
        get_template_part('template-parts/popIn', 'none');
    } 
?>

//if it is this page, do not show:

<?php
if ( (!is_page('trading-education-webinars') ) ){
    get_template_part('template-parts/popIn', 'none');
} 
?>

```

How do I combine the two so that it shows (get\_template\_part) if the field **has the value** and **is not the specified page**

```
//this fails

<?php
    $values = get_field( 'recast_video' );
    if ( ($values) || (!is_page('trading-education-webinars') ) ){
        get_template_part('template-parts/popIn', 'none');
    } 
?>  

```

Answer: 
found solution, uri.encode has default argument of
`def char_unescaped?(char) when char in 0..0x10FFFF do
 char_reserved?(char) or char_unreserved?(char)
 end`
for the second argument, by passing char\_unreserved, the function will now encode reserved characters

`URI.encode(" & ", &URI.char_unreserved?(&1))
"%20%26%20"`
`URI.encode/2` accepts second optional argument - a function to determine whether or not skip encode a char. So we can use the function that returns false (not skip) for any char:

```
URI.encode("&", fn(_) -> false end)
"%26"

```