• Resolved meskunas

    (@meskunas)


    I have a WordPress website that requires certain scripts to be run based on if category, or if page etc.. I need to be able to add to this, if exists in URL then…

    Here is what I have now

    ‘<?php
    if (is_front_page()) { include(“empty.php”); }
    elseif (is_home()) { include(“empty.php”); }
    elseif (is_page( array(‘691’, ‘850’, ‘2072’, ‘2064’, ‘2077’, ‘2052’))) { include(“empty.php”); }
    elseif (is_single( array(‘480’, ‘36094’, ’26’))) { include(“empty.php”); }
    elseif (in_category( array(’42’, ’26’, ‘marketplace’, ‘Obituaries’, ‘obituaries’))) { include(“empty.php”); }
    else { include(“paywall.php”); }
    ?>’

    I want to be able to add this, if URL contains (array(‘events’, ‘calendar’, ‘movies’) then include empty.php

    I am having problems finding code to do this. Perhaps add a function to functions.php and call it ‘elseif(in_url(array….’

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘If URL then get this’ is closed to new replies.