• Resolved meskunas

    (@meskunas)


    I have this included in the header of every page just before the closing </head>

    <?php
    if (is_front_page()) { include(“empty.php”); }
    elseif (is_home()) { include(“empty.php”); }
    elseif (is_page( array(‘691’, ‘32003’, ‘26160’, ‘35582’, ‘34751’, ‘34351’, ‘32510’, ‘32275’, ’28’, ’34’, ‘295’, ‘671’, ‘674’, ‘686’, ‘847’, ‘857’, ‘2527’, ‘1890’, ‘2056’, ‘6588’, ‘12912’, ‘668’, ‘259’, ‘2013’, ‘833’, ‘853’, ‘850’, ‘2072’, ‘2064’, ‘2077’, ‘2052’))) { include(“empty.php”); }
    elseif (is_single( array(‘480’, ‘36094’))) { include(“empty.php”); }
    elseif (is_category( array(’42’, ’26’, ‘marketplace’, ‘Obituaries’, ‘obituaries’))) { include(“empty.php”); }
    else { include(“paywall.php”); }
    ?>

    It is not working when folks are looking at individual posts under category 26 obituaries.

    Permanlink format is custom: /%post_id%/%postname%/

    Is it because it doesn’t know that the page contains that category yet?

    – Jim

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter meskunas

    (@meskunas)

    Note, this was working until WordPress 4.1.2 was released.

    Michael

    (@alchymyth)

    when folks are looking at individual posts under category 26 obituaries

    is_category() only checks for category archives;

    try to use in_category() although that might not be reliable if used outside the loop.

    Thread Starter meskunas

    (@meskunas)

    Thank you, this cured it.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Array Not excluding categories’ is closed to new replies.