Skip to content

Commit c92acbe

Browse files
committed
All: generalize banner; read banner message from post_meta
1 parent a530e38 commit c92acbe

File tree

3 files changed

+23
-25
lines changed

3 files changed

+23
-25
lines changed

themes/api.jquery.com/index.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
<?php get_header(); ?>
1+
<?php
2+
// Set banner in post meta for the header to display it
3+
update_post_meta(
4+
get_the_ID(),
5+
'banner',
6+
'jQuery 4.0 is currently in beta. Once released, jQuery 3.x will only receive critical updates. Learn more about our <a href="https://jquery.com/support/">Version Support</a>.'
7+
);
8+
get_header();
9+
?>
10+
211
<div class="content-right listing twelve columns">
312
<div id="content">
413
<h1 class="page-title">jQuery API</h1>

themes/jquery/css/base.css

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -884,20 +884,15 @@ iframe {
884884
/* Support message at top of page.
885885
========================================================================== */
886886

887-
#support-message {
888-
display: flex;
889-
justify-content: center;
887+
#banner {
888+
text-align: center;
890889
background-color: #dddddd;
891-
padding: 4px 4px;
890+
padding: 4px 20px;
892891
font-size: 15px;
892+
color: #333; /* jQuery Black */
893893
}
894-
#support-message span {
895-
text-align: center;
896-
padding-left: 20px;
897-
padding-right: 20px;
898-
}
899-
#support-message span a {
900-
color: #222;
894+
#banner a:hover {
895+
text-decoration: none;
901896
}
902897

903898
/* Global Nav
@@ -1414,8 +1409,7 @@ pre b {
14141409

14151410
#content img.full,
14161411
#content img.left,
1417-
#content img.right,
1418-
#banner img.full {
1412+
#content img.right {
14191413
box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.20);
14201414
}
14211415

@@ -1478,10 +1472,6 @@ pre b {
14781472
margin-bottom: 20px;
14791473
}
14801474

1481-
#portfolio.media #banner .embed {
1482-
margin-bottom: 40px;
1483-
}
1484-
14851475
.embed iframe,
14861476
.embed_media iframe,
14871477
.embed object,

themes/jquery/header.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,12 @@
3939
</head>
4040
<body <?php body_class(); ?>>
4141

42-
<?php if (is_front_page()) { ?>
43-
44-
<div id="support-message" class="support-message">
45-
<span style="">jQuery 4 is currently in beta. Soon jQuery 3 will reach EOL along with versions 1 and 2. Learn more about our&nbsp;<a href="https://jquery.com/support/">Version&nbsp;Support</a>.</span>
46-
</div>
47-
48-
<?php } ?>
42+
<!-- Render the banner if there's a banner message in post_meta -->
43+
<?php if ( get_post_meta( $post->ID, "banner" ) ) : ?>
44+
<div id="banner">
45+
<?php echo get_post_meta( $post->ID, "banner", true ); ?>
46+
</div>
47+
<?php endif; ?>
4948

5049
<header>
5150
<section id="global-nav">

0 commit comments

Comments
 (0)