Commit 81b7a2be authored by Simon's avatar Simon

Categories without pages added

parent 53f3c97d
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -75,6 +75,7 @@ get_header();
if (isset($termID)) {
$pages = getOptions($str);
$options = array_filter($pages, function ($pages) use ($termID) { return ($pages['termID'] == $termID); } );
if (count($options) > 0):
......@@ -95,9 +96,16 @@ get_header();
$page = get_term_meta( $termID, 'page-id', true);
if (isset($page)):
if (isset($page) && isset($page['post_title'])):
$res['name'] = $page['post_title'];
$res['pageURL'] = get_page_link( $page['ID'] );
else:
$term = get_term( $termID, $str );
if (isset($term) && isset($term->name)):
$res['name'] = $term->name;
$res['pageURL'] = ($str == 'city') ? '/?city=' . $term->name . '&s=' : '/?city=&s=' . $term->name;
endif;
endif;
endif;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment