$do_not_duplicate is not working in genesis theme

EDIT: Instead of all that, you could just use a meta_query and “NOT IN” to exclude the feature stories from your second query. That’s the easiest answer.

Check out this meta query documentation for help.


1, you need to have do_not_duplicate be a global array in order access it across functions (pretty sure).

2, you are overwriting it at the beginning of each function with <?php $do_not_duplicate = array(); ?>

Try taking out the part where you declare it as an array in whichever function comes 2nd. Instead echo it out to the console using this: //Debug in console
echo '<script> console.dir(' . json_encode($do_not_duplicate) . '); </script>';

Hold on to that little piece of code, it has made my life so much easier for debugging variables and such.

If that doesn’t work, declare the $do_not_duplicate as a global variable, and that should get the job done.