inc.php
980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
require_once 'class-wp-bootstrap-navwalker.php';
require_once 'hooks-filters.php';
require_once 'breadcrumb.php';
require_once 'shortcodes.php';
require_once 'search-extras.php';
require_once 'disable-comments.php';
require_once 'blocks.php';
require_once 'widgets-area.php';
require_once 'commands.php';
require_once 'rest.php';
function get_global_excluded_posts() {
$all_cats = get_categories();
$excluded = [];
foreach($all_cats as $cat) {
$main_index_page = get_field('main_index_page', $cat);
if($main_index_page) {
$excluded[] = $main_index_page->ID;
}
}
return $excluded;
}
function get_for_excluded_cats() {
$all_cats = get_categories();
$excluded = [];
foreach($all_cats as $cat) {
$latest_exclusive = get_field('exclude_from_latest_articles', $cat);
if($latest_exclusive) {
$excluded[] = $cat->term_id;
}
}
return $excluded;
}