File tree Expand file tree Collapse file tree 2 files changed +17
-19
lines changed Expand file tree Collapse file tree 2 files changed +17
-19
lines changed Original file line number Diff line number Diff line change 91
91
.example-container .example-padding {
92
92
padding : 48px ;
93
93
}
94
+
95
+ .adsanchor {
96
+ bottom : 0 ;
97
+ display : block;
98
+ position : fixed;
99
+ width : 100% ;
100
+ max-height : 100px ;
101
+ height : 75px ;
102
+ }
Original file line number Diff line number Diff line change @@ -4,11 +4,8 @@ import Footer from '@theme-original/Footer'
4
4
// import AdsContainerElement from '@site/src/components/AdsContainerElement'
5
5
6
6
export default function FooterWrapper ( props ) {
7
- let shadoWindow = null
8
-
9
7
useEffect ( ( ) => {
10
8
if ( typeof window !== 'undefined' ) {
11
- shadoWindow = window
12
9
const scriptElement = document . createElement ( 'script' )
13
10
scriptElement . src =
14
11
'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-7420210265158247'
@@ -21,27 +18,19 @@ export default function FooterWrapper(props) {
21
18
}
22
19
}
23
20
document . body . appendChild ( scriptElement )
21
+
22
+ const adsElement = document . createElement ( 'ins' )
23
+ adsElement . classList . add ( 'adsbygoogle' )
24
+ adsElement . classList . add ( 'adsanchor' )
25
+ adsElement . setAttribute ( 'ad-client' , 'ca-pub-7420210265158247' )
26
+ adsElement . setAttribute ( 'ad-slot' , '8159529807' )
27
+ adsElement . setAttribute ( 'full-width-responsive' , 'true' )
28
+ document . body . appendChild ( adsElement )
24
29
}
25
30
} , [ ] )
26
31
27
32
return (
28
33
< >
29
- { shadoWindow && shadoWindow . document . body . clientWidth <= 768 && (
30
- < ins
31
- className = "adsbygoogle"
32
- style = { {
33
- bottom : 0 ,
34
- display : 'block' ,
35
- position : 'fixed' ,
36
- width : '100%' ,
37
- maxHeight : '100px' ,
38
- height : '75px' ,
39
- } }
40
- data-ad-client = "ca-pub-7420210265158247"
41
- data-ad-slot = "8159529807"
42
- data-full-width-responsive = "true"
43
- />
44
- ) }
45
34
< Footer { ...props } />
46
35
{ /* <AdsContainerElement id="mobile-anchor-ads" /> */ }
47
36
</ >
You can’t perform that action at this time.
0 commit comments