Conditional using get_the_ID() not working

I'm using this script to not show title on a specific page

?php if (get_the_ID() != 50){ ?

Now I need to add another page:

?php if ((get_the_ID() != 50) || (get_the_ID() != 317)){ ?

But it's not working.

Topic get-the-id php Wordpress

Category Web


Try -

<?php if ((get_the_ID() != 50) && (get_the_ID() != 317)){ ?>

It should be AND not OR for this compare.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.