diff --git a/_includes/footer_custom.html b/_includes/footer_custom.html
index ae4c29c..f95bc51 100644
--- a/_includes/footer_custom.html
+++ b/_includes/footer_custom.html
@@ -9,22 +9,33 @@
| where_exp: "item", "item.title != nil"
| where_exp: "item", "item.nav_exclude != true" -%}
-
- children
-
-
-{%- for item in children_pages -%}
- - {{ item.nav_order }} - {{ item.title }} - {{ item.url }} - {{ item.parent }}
-{%- endfor -%}
-
-
- root
-
-
-{%- for item in root_pages -%}
- - {{ item.nav_order }} - {{ item.title }} - {{ item.url }} - {{ item.parent }}
+{%- if page.parent -%}
+ {%- assign root_page page.parent -%}
+{%- else -%}
+ {%- assign root_page page.title -%}
+{%- endif -%}
+
+{%- for item in sorted_pages_site -%}
+ {%- if item.title == page.title -%}
+ {%- assign num_of_pages = forloop.length -%}
+ {%- assign next_i = forloop.index0 | plus: 1 -%}
+ {%- assign prev_i = forloop.index0 | minus: 1 -%}
+ {%- assign next_page = sorted_pages_site[next_i] -%}
+ {%- assign prev_page = sorted_pages_site[prev_i] -%}
+ {%- endif -%}
{%- endfor -%}
-
+
+{%- if prev_page -%}
+
+ {{ prev_page.url }}
+
+{%- endif -%}';
+
+{%- if next_page -%}
+
+ {{ next_page.url }}
+
+{%- endif -%}
{%- if site.footer_content -%}