Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Commit

Permalink
Add footer navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinan committed Oct 9, 2020
1 parent a9fdb24 commit ed3ccb6
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 0 deletions.
35 changes: 35 additions & 0 deletions assets/css/ie.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions assets/sass/06-components/footer-navigation.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

.footer-navigation {
font-size: var(--primary-nav--font-size);
}

.footer-navigation-wrapper {
display: flex;
position: relative;
justify-content: center;
flex-wrap: wrap;
list-style: none;
margin: 0 auto;
padding-left: 0;

li {
display: inline;
margin: var(--global--spacing-vertical) calc(0.5 * var(--global--spacing-horizontal));
position: relative;
}

a {
padding: calc(1.25 * var(--primary-nav--padding)) var(--primary-nav--padding);

&:hover {
text-decoration: underline;
text-decoration-style: dotted;
text-decoration-skip-ink: none;
}
}

.sub-menu-toggle {
display: none;
}
}
2 changes: 2 additions & 0 deletions assets/sass/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
* 404..................404 styles.
* Search...............Search styles.
* Navigation...........Navigation styles.
* Footer Navigation....Footer Navigation styles.
* Pagination...........Pagination styles.
* Single...............Single page and post styles.
* Posts and pages......Misc, sticky post styles.
Expand Down Expand Up @@ -112,6 +113,7 @@
@import "06-components/search";
@import "06-components/comments";
@import "06-components/navigation";
@import "06-components/footer-navigation";
@import "06-components/pagination";
@import "06-components/widgets";

Expand Down
1 change: 1 addition & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function twenty_twenty_one_setup() {
register_nav_menus(
array(
'primary' => esc_html__( 'Primary Navigation', 'twentytwentyone' ),
'footer' => __( 'Footer Navigation', 'twentytwentyone' ),
)
);

Expand Down
24 changes: 24 additions & 0 deletions inc/menu-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,27 @@ function twenty_twenty_one_add_sub_menu_toggle( $output, $item, $depth, $args )
return $output;
}
add_filter( 'walker_nav_menu_start_el', 'twenty_twenty_one_add_sub_menu_toggle', 10, 4 );


/**
* Displays SVG icons in the footer navigation.
*
* @param string $item_output The menu item's starting HTML output.
* @param WP_Post $item Menu item data object.
* @param int $depth Depth of the menu. Used for padding.
* @param stdClass $args An object of wp_nav_menu() arguments.
* @return string The menu item output with social icon.
*/
function twenty_twenty_one_nav_menu_social_icons( $item_output, $item, $depth, $args ) {
// Change SVG icon inside social links menu if there is supported URL.
if ( 'footer' === $args->theme_location ) {
if ( ! empty( $svg ) ) {
$svg = twenty_twenty_one_get_icon_svg( $item->url );
$item_output = str_replace( $args->link_after, '</span>' . $svg, $item_output );
}
}

return $item_output;
}

add_filter( 'walker_nav_menu_start_el', 'twenty_twenty_one_nav_menu_social_icons', 10, 4 );
35 changes: 35 additions & 0 deletions style-rtl.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ed3ccb6

Please sign in to comment.