Strange... I put an if statement for `$testvalue = 0`. The else part runs and when I echo the value of the `$testvalue` it gives me a 0.

So what is the true value of `$testvalue`?

I need to be able for the if the part to run.

I am trying to use the `post_exists()` function to check if a post exists in the database. If it doesn't exist, I want to call the `insert_post()` function to auto create a new post or page. but I need this returning a 0 to work.

any advice on why `$testvalue = 0` is not running the if part `(echo "before: " . $testvalue)`

```
if ( ! is_admin() ) {
require_once( ABSPATH . 'wp-admin/includes/post.php' );
}

add_action('wp_footer', 'my_customoutput');

function my_customoutput(){

$checklinktitle = 'Events 321 Page';

$testvalue = post_exists( $checklinktitle );

if ($testvalue = 0) {
    echo 'Before: ' . $testvalue;
} else {
    echo 'Firing of Else statement but the value of $testvalue is ' . $testvalue;
}
}

```