Last active
February 7, 2018 11:56
-
-
Save ncserny/b3849ec43c68b088c1da71fda1f80e4b to your computer and use it in GitHub Desktop.
WordPress Instant Articles Query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('pre_get_posts', 'instant_articles_query_modified', 10, 2); | |
function instant_articles_query_modified($query) { | |
if ($query->is_main_query() && null !== INSTANT_ARTICLES_SLUG && $query->is_feed(INSTANT_ARTICLES_SLUG)) { | |
$query->set('cat', 1,2); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment