File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
public_html/wp-content/mu-plugins Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,8 @@ function canonical_link_past_home_pages_to_current_year() {
6666 */
6767function add_notification_styles () { ?>
6868 <style type="text/css">
69- html:not(#specificity-hack) {
69+ html:not(#specificity-hack),
70+ .wordcamp-latest-site-notify-fixed-position-fix {
7071 /* 44 = 10px x2 for padding, 24px for line height. */
7172 margin-top: calc(44px + var(--wp-admin--admin-bar--height, 0px)) !important;
7273 }
@@ -105,6 +106,23 @@ function add_notification_styles() { ?>
105106 color: #72aee6;
106107 }
107108 </style>
109+ <script>
110+ document.addEventListener("DOMContentLoaded", (event) => {
111+ const fixedElements = document.querySelectorAll('nav, nav *'); // Select all elements
112+ const fixedElementsArray = Array.from(fixedElements);
113+
114+ const fixedElementsWithPositionFixed = fixedElementsArray.filter(element => {
115+ const computedStyle = getComputedStyle(element);
116+ return computedStyle.position === 'fixed';
117+ });
118+
119+ console.log(fixedElementsWithPositionFixed);
120+
121+ fixedElementsWithPositionFixed.forEach(element => {
122+ element.classList.add('wordcamp-latest-site-notify-fixed-position-fix')
123+ });
124+ });
125+ </script>
108126<?php }
109127
110128/**
You can’t perform that action at this time.
0 commit comments