Initial commit

This commit is contained in:
Ben Goldsworthy 2017-01-12 23:10:07 +00:00
commit 28e6ddf404
1083 changed files with 191734 additions and 0 deletions

View file

@ -0,0 +1,736 @@
/**
* Jetpack Portfolio Shortcode
*/
.site .portfolio-entry {
margin-bottom: 1.6em;
}
.site .portfolio-entry-title,
.site .portfolio-entry-meta,
.site .portfolio-entry-content {
font-size: 1.2rem;
font-size: 12px;
line-height: 1.5;
}
.site .portfolio-featured-image + .portfolio-entry-title {
margin-top: 0.75em;
margin-bottom: 0.75em;
}
.site .portfolio-entry-meta {
font-family: "Noto Sans", sans-serif;
}
.site .portfolio-entry-content .more-link:after {
font-size: 16px;
top: 1px;
}
/**
* Jetpack Widgets
*/
/* Blog Subscriptions Widget */
.jetpack_subscription_widget #subscribe-email input {
padding: 0.375em;
width: 100%;
}
.jetpack_subscription_widget form > :last-child {
margin-bottom: 0;
}
/* Display WordPress Posts Widget */
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts {
margin: 0;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts h4 {
font-size: inherit;
margin: 0 0 1.6em;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts img {
margin: 0 0 1.6em;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts p {
font-size: inherit;
line-height: 1.6 !important;
margin: 0 0 1.6em !important;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts > :last-child {
margin-bottom: 0 !important;
}
/* Gallery Widget */
.widget-gallery .slideshow-window {
border-radius: 0;
}
/* Gravatar Profile Widget */
.widget-area .widget-grofile .grofile-thumbnail {
border-radius: 50%;
max-width: 200px;
}
.widget-area .widget-grofile h4 {
margin: 1.6em 0 0;
}
.widget-area .widget-grofile .grofile-accounts {
margin-top: 0.8em;
}
/* Image Widget */
.widget_image .wp-caption {
margin-bottom: 0;
}
.widget_image .wp-caption-text {
padding-bottom: 0;
}
/* RSS Links Widget */
.widget_rss_links img {
position: relative;
top: -2px;
}
/* List type widgets */
.widget_rss_links ul,
.widget_top-posts ul ,
.widget_upcoming_events_widget ul {
list-style: none;
margin: 0;
}
.widget_rss_links li,
.widget_top-posts li,
.widget_upcoming_events_widget li {
border-top: 1px solid #eaeaea;
border-top: 1px solid rgba(51, 51, 51, 0.1);
padding: 0.7667em 0;
}
.widget_rss_links li:first-child,
.widget_top-posts li:first-child,
.widget_upcoming_events_widget li:first-child {
border-top: 0;
padding-top: 0;
}
.widget_rss_links li:last-child,
.widget_top-posts li:last-child,
.widget_upcoming_events_widget li:last-child {
padding-bottom: 0;
}
/**
* Shortcodes Embeds
*/
/* Facebook */
.fb_iframe_widget {
margin-bottom: 1.6em;
max-width: 100%;
}
.fb_iframe_widget span {
max-width: 100%;
}
/* Gist */
.gist table {
table-layout: auto;
}
.site .gist .gist-file {
margin-bottom: 1.5em;
}
/* Googlemaps */
.googlemaps {
margin-bottom: 1.6em;
}
.googlemaps iframe {
margin-bottom: 0;
}
/* Polldaddy */
.PDS_Poll {
display: block !important;
margin-bottom: 1.6em;
}
.PDS_Poll .pds-box {
max-width: 100%;
width: auto;
}
/* Presentation */
.site .presentation-wrapper {
margin: 0 auto 1.6em;
}
/* Recipes */
.site .jetpack-recipe {
border: 0;
margin: 0 0 1.6em;
padding: 0;
}
.site .jetpack-recipe-title {
border: 0;
margin-top: 0;
padding: 0;
}
.site .jetpack-recipe .jetpack-recipe-meta {
font-size: inherit;
margin: 0;
}
/* Slideshow */
.site .slideshow-window {
border-radius: 0;
margin-bottom: 1.6em;
}
/* Twitter-timeline */
iframe[id*="twitter-widget-"] {
display: block;
}
/* Vine */
.vine-embed {
display: block;
}
/* VideoPress */
.site .video-player {
margin-bottom: 1.6em;
padding: 0;
}
.video-player object {
margin-bottom: 0;
}
/**
* Tiled gallery
*/
.site .tiled-gallery {
margin-bottom: 1.6em;
}
/**
* Jetpack Comments
*/
.comment-form iframe {
margin: 0;
}
.comment-form .subscribe-label {
font-weight: 400;
text-transform: none;
}
.comment-subscription-form {
font-size: 12px;
font-size: 1.2rem;
line-height: 1.5em;
margin: 2em 0 0;
}
.comment-subscription-form + .comment-subscription-form {
margin-top: 1em;
}
/**
* Sharing
*/
.hentry div.sharedaddy h3.sd-title,
.hentry h3.sd-title {
font-family: "Noto Sans", sans-serif;
font-size: 12px;
font-size: 1.2rem;
line-height: 1;
margin: 0 0 1em 0;
opacity: 0.7;
text-transform: uppercase;
}
/**
* Related Posts
*/
.hentry #jp-relatedposts {
margin: 0;
padding-top: 0;
}
.hentry .jp-relatedposts-post-title a {
border-bottom: 0;
}
.hentry .jp-relatedposts-headline em:before {
opacity: 0.7;
}
.hentry div#jp-relatedposts h3.jp-relatedposts-headline {
font-family: "Noto Sans", sans-serif;
font-size: 12px;
font-size: 1.2rem;
opacity: 0.7;
text-transform: uppercase;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items-visual {
margin-left: 0;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post {
margin-bottom: 1.6em;
opacity: 1;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items-visual h4.jp-relatedposts-post-title,
.hentry div#jp-relatedposts div.jp-relatedposts-items p {
font-size: 1.2rem;
font-size: 12px;
line-height: 1.5;
}
.hentry .jp-relatedposts-post-title {
font-weight: 700;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a {
font-weight: inherit;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items div.jp-relatedposts-post:hover .jp-relatedposts-post-title a,
.hentry div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a {
text-decoration: none;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-context,
.hentry div#jp-relatedposts div.jp-relatedposts-items-visual div.jp-relatedposts-post-nothumbs p.jp-relatedposts-post-excerpt {
opacity: 0.7;
}
.hentry .jp-relatedposts-post-img {
margin-bottom: 0.6em;
}
/**
* Stats
*/
#wpstats {
display: none;
}
/**
* Media Queries
*/
@media screen and (min-width: 46.25em) {
.site .portfolio-entry {
margin-bottom: 1.6471em;
}
.site .portfolio-entry-title,
.site .portfolio-entry-meta,
.site .portfolio-entry-content {
font-size: 1.4rem;
font-size: 14px;
}
.site .portfolio-entry-content .more-link:after {
top: 3px;
}
.site .hentry .gist .gist-file {
margin-bottom: 1.75em;
}
.site .widget .gist .gist-file {
margin-bottom: 1.3125em;
}
.hentry .fb_iframe_widget,
.hentry .googlemaps,
.hentry .PDS_Poll,
.site .hentry .presentation-wrapper,
.site .hentry .jetpack-recipe,
.site .hentry .slideshow-window,
.site .hentry .video-player {
margin-bottom: 1.6471em;
}
.widget .fb_iframe_widget,
.widget .googlemaps,
.widget .PDS_Poll,
.site .widget .presentation-wrapper,
.site .widget .jetpack-recipe,
.site .widget .slideshow-window,
.site .widget .video-player {
margin-bottom: 1.5em;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts h4,
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts img {
margin: 0 0 1.5em;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts p {
line-height: 1.5 !important;
margin: 0 0 1.5em !important;
}
.widget-area .widget-grofile h4 {
margin: 1.5em 0 0;
}
.widget-area .widget-grofile .grofile-accounts {
margin-top: 0.75em;
}
.jetpack_subscription_widget #subscribe-email input {
padding: 0.5625em;
}
.widget_rss_links li,
.widget_top-posts li,
.widget_upcoming_events_widget li {
padding: 0.9643em 0;
}
.site .tiled-gallery {
margin-bottom: 1.6471em;
}
.jetpack-video-wrapper {
margin-bottom: 1.6471em;
}
.comment-subscription-form {
font-size: 14px;
font-size: 1.4rem;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post {
margin-bottom: 0;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items-visual h4.jp-relatedposts-post-title,
.hentry div#jp-relatedposts div.jp-relatedposts-items p {
font-size: 1.4rem;
font-size: 14px;
}
.jp-relatedposts-post-img {
margin-bottom: 0.6176em;
}
}
@media screen and (min-width: 55em) {
.site .portfolio-entry {
margin-bottom: 1.6842em
}
.site .portfolio-entry-title,
.site .portfolio-entry-meta,
.site .portfolio-entry-content {
font-size: 1.6rem;
font-size: 16px;
}
.site .portfolio-entry-content .more-link:after {
font-size: 24px;
top: 0;
}
.site .hentry .gist .gist-file {
margin-bottom: 2em;
}
.site .widget .gist .gist-file {
margin-bottom: 1.5em;
}
.hentry .fb_iframe_widget,
.hentry .googlemaps,
.hentry .PDS_Poll,
.site .hentry .presentation-wrapper,
.site .hentry .jetpack-recipe,
.site .hentry .slideshow-window,
.site .hentry .video-player {
margin-bottom: 1.6842em;
}
.site .tiled-gallery {
margin-bottom: 1.6842em;
}
.jetpack_subscription_widget #subscribe-email input {
padding: 0.75em;
}
.widget_rss_links li,
.widget_top-posts li,
.widget_upcoming_events_widget li {
padding: 0.7188em 0;
}
.jetpack-video-wrapper {
margin-bottom: 1.6842em;
}
.comment-subscription-form {
font-size: 16px;
font-size: 1.6rem;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items-visual h4.jp-relatedposts-post-title,
.hentry div#jp-relatedposts div.jp-relatedposts-items p {
font-size: 1.6rem;
font-size: 16px;
line-height: 1.5em;
}
.jp-relatedposts-post-img {
margin-bottom: 0.6315em;
}
}
@media screen and (min-width: 59.6875em) {
.site .portfolio-entry {
margin-bottom: 1.6em
}
.site .portfolio-entry-title,
.site .portfolio-entry-meta,
.site .portfolio-entry-content {
font-size: 1.2rem;
font-size: 12px;
}
.site .portfolio-entry-content .more-link:after {
font-size: 16px;
top: 1px;
}
.site .hentry .gist .gist-file {
margin-bottom: 1.5em;
}
.site .widget .gist .gist-file {
margin-bottom: 1.125em;
}
.hentry .fb_iframe_widget,
.hentry .googlemaps,
.hentry .PDS_Poll,
.site .hentry .presentation-wrapper,
.site .hentry .jetpack-recipe,
.site .hentry .slideshow-window,
.site .hentry .video-player {
margin-bottom: 1.6em;
}
.site .tiled-gallery {
margin-bottom: 1.6em;
}
.jetpack_subscription_widget #subscribe-email input {
padding: 0.4583em;
}
.jetpack-video-wrapper {
margin-bottom: 1.6em;
}
.widget-area .widget-grofile .grofile-thumbnail {
max-width: 100%;
}
.widget_rss_links li,
.widget_top-posts li,
.widget_upcoming_events_widget li {
padding: 0.4583em 0;
}
.comment-subscription-form {
font-size: 12px;
font-size: 1.2rem;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items-visual h4.jp-relatedposts-post-title,
.hentry div#jp-relatedposts div.jp-relatedposts-items p {
font-size: 1.2rem;
font-size: 12px;
line-height: 1.5;
}
.jp-relatedposts-post-img {
margin-bottom: 0.6em;
}
}
@media screen and (min-width: 68.75em) {
.site .portfolio-entry {
margin-bottom: 1.6471em
}
.site .portfolio-entry-title,
.site .portfolio-entry-meta,
.site .portfolio-entry-content {
font-size: 1.4rem;
font-size: 14px;
}
.site .portfolio-entry-content .more-link:after {
top: 3px;
}
.site .hentry .gist .gist-file {
margin-bottom: 1.75em;
}
.site .widget .gist .gist-file {
margin-bottom: 1.3125em;
}
.hentry .fb_iframe_widget,
.hentry .googlemaps,
.hentry .PDS_Poll,
.site .hentry .presentation-wrapper,
.site .hentry .jetpack-recipe,
.site .hentry .slideshow-window,
.site .hentry .video-player {
margin-bottom: 1.6471em;
}
.site .tiled-gallery {
margin-bottom: 1.6471em;
}
.jetpack_subscription_widget #subscribe-email input {
padding: 0.5em;
}
.widget_rss_links li,
.widget_top-posts li,
.widget_upcoming_events_widget li {
padding: 0.4643em 0;
}
.jetpack-video-wrapper {
margin-bottom: 1.6471em;
}
.comment-subscription-form {
font-size: 14px;
font-size: 1.4rem;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items-visual h4.jp-relatedposts-post-title,
.hentry div#jp-relatedposts div.jp-relatedposts-items p {
font-size: 14px;
font-size: 1.4rem;
}
.jp-relatedposts-post-img {
margin-bottom: 0.6176em;
}
}
@media screen and (min-width: 77.5em) {
.site .portfolio-entry {
margin-bottom: 1.6842em
}
.site .portfolio-entry-title,
.site .portfolio-entry-meta,
.site .portfolio-entry-content {
font-size: 1.6rem;
font-size: 16px;
}
.site .portfolio-entry-content .more-link:after {
font-size: 24px;
top: 0;
}
.site .hentry .gist .gist-file {
margin-bottom: 2em;
}
.site .widget .gist .gist-file {
margin-bottom: 1.5em;
}
.hentry .fb_iframe_widget,
.hentry .googlemaps,
.hentry .PDS_Poll,
.site .hentry .presentation-wrapper,
.site .hentry .jetpack-recipe,
.site .hentry .slideshow-window,
.site .hentry .video-player {
margin-bottom: 1.6842em;
}
.widget_rss_links li,
.widget_top-posts li,
.widget_upcoming_events_widget li {
padding: 0.4688em 0;
}
.site .tiled-gallery {
margin-bottom: 1.6842em;
}
.jetpack-video-wrapper {
margin-bottom: 1.6842em;
}
.hentry div.sharedaddy h3.sd-title,
.hentry div#jp-relatedposts h3.jp-relatedposts-headline {
font-size: 13px;
font-size: 1.3rem;
}
.comment-subscription-form {
font-size: 16px;
font-size: 1.6rem;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items-visual h4.jp-relatedposts-post-title,
.hentry div#jp-relatedposts div.jp-relatedposts-items p {
font-size: 16px;
font-size: 1.6rem;
line-height: 1.5em;
}
.jp-relatedposts-post-img {
margin-bottom: 0.6315em;
}
}

View file

@ -0,0 +1,736 @@
/**
* Jetpack Portfolio Shortcode
*/
.site .portfolio-entry {
margin-bottom: 1.6em;
}
.site .portfolio-entry-title,
.site .portfolio-entry-meta,
.site .portfolio-entry-content {
font-size: 1.2rem;
font-size: 12px;
line-height: 1.5;
}
.site .portfolio-featured-image + .portfolio-entry-title {
margin-top: 0.75em;
margin-bottom: 0.75em;
}
.site .portfolio-entry-meta {
font-family: "Noto Sans", sans-serif;
}
.site .portfolio-entry-content .more-link:after {
font-size: 16px;
top: 1px;
}
/**
* Jetpack Widgets
*/
/* Blog Subscriptions Widget */
.jetpack_subscription_widget #subscribe-email input {
padding: 0.375em;
width: 100%;
}
.jetpack_subscription_widget form > :last-child {
margin-bottom: 0;
}
/* Display WordPress Posts Widget */
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts {
margin: 0;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts h4 {
font-size: inherit;
margin: 0 0 1.6em;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts img {
margin: 0 0 1.6em;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts p {
font-size: inherit;
line-height: 1.6 !important;
margin: 0 0 1.6em !important;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts > :last-child {
margin-bottom: 0 !important;
}
/* Gallery Widget */
.widget-gallery .slideshow-window {
border-radius: 0;
}
/* Gravatar Profile Widget */
.widget-area .widget-grofile .grofile-thumbnail {
border-radius: 50%;
max-width: 200px;
}
.widget-area .widget-grofile h4 {
margin: 1.6em 0 0;
}
.widget-area .widget-grofile .grofile-accounts {
margin-top: 0.8em;
}
/* Image Widget */
.widget_image .wp-caption {
margin-bottom: 0;
}
.widget_image .wp-caption-text {
padding-bottom: 0;
}
/* RSS Links Widget */
.widget_rss_links img {
position: relative;
top: -2px;
}
/* List type widgets */
.widget_rss_links ul,
.widget_top-posts ul ,
.widget_upcoming_events_widget ul {
list-style: none;
margin: 0;
}
.widget_rss_links li,
.widget_top-posts li,
.widget_upcoming_events_widget li {
border-top: 1px solid #eaeaea;
border-top: 1px solid rgba(51, 51, 51, 0.1);
padding: 0.7667em 0;
}
.widget_rss_links li:first-child,
.widget_top-posts li:first-child,
.widget_upcoming_events_widget li:first-child {
border-top: 0;
padding-top: 0;
}
.widget_rss_links li:last-child,
.widget_top-posts li:last-child,
.widget_upcoming_events_widget li:last-child {
padding-bottom: 0;
}
/**
* Shortcodes Embeds
*/
/* Facebook */
.fb_iframe_widget {
margin-bottom: 1.6em;
max-width: 100%;
}
.fb_iframe_widget span {
max-width: 100%;
}
/* Gist */
.gist table {
table-layout: auto;
}
.site .gist .gist-file {
margin-bottom: 1.5em;
}
/* Googlemaps */
.googlemaps {
margin-bottom: 1.6em;
}
.googlemaps iframe {
margin-bottom: 0;
}
/* Polldaddy */
.PDS_Poll {
display: block !important;
margin-bottom: 1.6em;
}
.PDS_Poll .pds-box {
max-width: 100%;
width: auto;
}
/* Presentation */
.site .presentation-wrapper {
margin: 0 auto 1.6em;
}
/* Recipes */
.site .jetpack-recipe {
border: 0;
margin: 0 0 1.6em;
padding: 0;
}
.site .jetpack-recipe-title {
border: 0;
margin-top: 0;
padding: 0;
}
.site .jetpack-recipe .jetpack-recipe-meta {
font-size: inherit;
margin: 0;
}
/* Slideshow */
.site .slideshow-window {
border-radius: 0;
margin-bottom: 1.6em;
}
/* Twitter-timeline */
iframe[id*="twitter-widget-"] {
display: block;
}
/* Vine */
.vine-embed {
display: block;
}
/* VideoPress */
.site .video-player {
margin-bottom: 1.6em;
padding: 0;
}
.video-player object {
margin-bottom: 0;
}
/**
* Tiled gallery
*/
.site .tiled-gallery {
margin-bottom: 1.6em;
}
/**
* Jetpack Comments
*/
.comment-form iframe {
margin: 0;
}
.comment-form .subscribe-label {
font-weight: 400;
text-transform: none;
}
.comment-subscription-form {
font-size: 12px;
font-size: 1.2rem;
line-height: 1.5em;
margin: 2em 0 0;
}
.comment-subscription-form + .comment-subscription-form {
margin-top: 1em;
}
/**
* Sharing
*/
.hentry div.sharedaddy h3.sd-title,
.hentry h3.sd-title {
font-family: "Noto Sans", sans-serif;
font-size: 12px;
font-size: 1.2rem;
line-height: 1;
margin: 0 0 1em 0;
opacity: 0.7;
text-transform: uppercase;
}
/**
* Related Posts
*/
.hentry #jp-relatedposts {
margin: 0;
padding-top: 0;
}
.hentry .jp-relatedposts-post-title a {
border-bottom: 0;
}
.hentry .jp-relatedposts-headline em:before {
opacity: 0.7;
}
.hentry div#jp-relatedposts h3.jp-relatedposts-headline {
font-family: "Noto Sans", sans-serif;
font-size: 12px;
font-size: 1.2rem;
opacity: 0.7;
text-transform: uppercase;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items-visual {
margin-right: 0;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post {
margin-bottom: 1.6em;
opacity: 1;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items-visual h4.jp-relatedposts-post-title,
.hentry div#jp-relatedposts div.jp-relatedposts-items p {
font-size: 1.2rem;
font-size: 12px;
line-height: 1.5;
}
.hentry .jp-relatedposts-post-title {
font-weight: 700;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a {
font-weight: inherit;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items div.jp-relatedposts-post:hover .jp-relatedposts-post-title a,
.hentry div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a {
text-decoration: none;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-context,
.hentry div#jp-relatedposts div.jp-relatedposts-items-visual div.jp-relatedposts-post-nothumbs p.jp-relatedposts-post-excerpt {
opacity: 0.7;
}
.hentry .jp-relatedposts-post-img {
margin-bottom: 0.6em;
}
/**
* Stats
*/
#wpstats {
display: none;
}
/**
* Media Queries
*/
@media screen and (min-width: 46.25em) {
.site .portfolio-entry {
margin-bottom: 1.6471em;
}
.site .portfolio-entry-title,
.site .portfolio-entry-meta,
.site .portfolio-entry-content {
font-size: 1.4rem;
font-size: 14px;
}
.site .portfolio-entry-content .more-link:after {
top: 3px;
}
.site .hentry .gist .gist-file {
margin-bottom: 1.75em;
}
.site .widget .gist .gist-file {
margin-bottom: 1.3125em;
}
.hentry .fb_iframe_widget,
.hentry .googlemaps,
.hentry .PDS_Poll,
.site .hentry .presentation-wrapper,
.site .hentry .jetpack-recipe,
.site .hentry .slideshow-window,
.site .hentry .video-player {
margin-bottom: 1.6471em;
}
.widget .fb_iframe_widget,
.widget .googlemaps,
.widget .PDS_Poll,
.site .widget .presentation-wrapper,
.site .widget .jetpack-recipe,
.site .widget .slideshow-window,
.site .widget .video-player {
margin-bottom: 1.5em;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts h4,
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts img {
margin: 0 0 1.5em;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts p {
line-height: 1.5 !important;
margin: 0 0 1.5em !important;
}
.widget-area .widget-grofile h4 {
margin: 1.5em 0 0;
}
.widget-area .widget-grofile .grofile-accounts {
margin-top: 0.75em;
}
.jetpack_subscription_widget #subscribe-email input {
padding: 0.5625em;
}
.widget_rss_links li,
.widget_top-posts li,
.widget_upcoming_events_widget li {
padding: 0.9643em 0;
}
.site .tiled-gallery {
margin-bottom: 1.6471em;
}
.jetpack-video-wrapper {
margin-bottom: 1.6471em;
}
.comment-subscription-form {
font-size: 14px;
font-size: 1.4rem;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items .jp-relatedposts-post {
margin-bottom: 0;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items-visual h4.jp-relatedposts-post-title,
.hentry div#jp-relatedposts div.jp-relatedposts-items p {
font-size: 1.4rem;
font-size: 14px;
}
.jp-relatedposts-post-img {
margin-bottom: 0.6176em;
}
}
@media screen and (min-width: 55em) {
.site .portfolio-entry {
margin-bottom: 1.6842em
}
.site .portfolio-entry-title,
.site .portfolio-entry-meta,
.site .portfolio-entry-content {
font-size: 1.6rem;
font-size: 16px;
}
.site .portfolio-entry-content .more-link:after {
font-size: 24px;
top: 0;
}
.site .hentry .gist .gist-file {
margin-bottom: 2em;
}
.site .widget .gist .gist-file {
margin-bottom: 1.5em;
}
.hentry .fb_iframe_widget,
.hentry .googlemaps,
.hentry .PDS_Poll,
.site .hentry .presentation-wrapper,
.site .hentry .jetpack-recipe,
.site .hentry .slideshow-window,
.site .hentry .video-player {
margin-bottom: 1.6842em;
}
.site .tiled-gallery {
margin-bottom: 1.6842em;
}
.jetpack_subscription_widget #subscribe-email input {
padding: 0.75em;
}
.widget_rss_links li,
.widget_top-posts li,
.widget_upcoming_events_widget li {
padding: 0.7188em 0;
}
.jetpack-video-wrapper {
margin-bottom: 1.6842em;
}
.comment-subscription-form {
font-size: 16px;
font-size: 1.6rem;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items-visual h4.jp-relatedposts-post-title,
.hentry div#jp-relatedposts div.jp-relatedposts-items p {
font-size: 1.6rem;
font-size: 16px;
line-height: 1.5em;
}
.jp-relatedposts-post-img {
margin-bottom: 0.6315em;
}
}
@media screen and (min-width: 59.6875em) {
.site .portfolio-entry {
margin-bottom: 1.6em
}
.site .portfolio-entry-title,
.site .portfolio-entry-meta,
.site .portfolio-entry-content {
font-size: 1.2rem;
font-size: 12px;
}
.site .portfolio-entry-content .more-link:after {
font-size: 16px;
top: 1px;
}
.site .hentry .gist .gist-file {
margin-bottom: 1.5em;
}
.site .widget .gist .gist-file {
margin-bottom: 1.125em;
}
.hentry .fb_iframe_widget,
.hentry .googlemaps,
.hentry .PDS_Poll,
.site .hentry .presentation-wrapper,
.site .hentry .jetpack-recipe,
.site .hentry .slideshow-window,
.site .hentry .video-player {
margin-bottom: 1.6em;
}
.site .tiled-gallery {
margin-bottom: 1.6em;
}
.jetpack_subscription_widget #subscribe-email input {
padding: 0.4583em;
}
.jetpack-video-wrapper {
margin-bottom: 1.6em;
}
.widget-area .widget-grofile .grofile-thumbnail {
max-width: 100%;
}
.widget_rss_links li,
.widget_top-posts li,
.widget_upcoming_events_widget li {
padding: 0.4583em 0;
}
.comment-subscription-form {
font-size: 12px;
font-size: 1.2rem;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items-visual h4.jp-relatedposts-post-title,
.hentry div#jp-relatedposts div.jp-relatedposts-items p {
font-size: 1.2rem;
font-size: 12px;
line-height: 1.5;
}
.jp-relatedposts-post-img {
margin-bottom: 0.6em;
}
}
@media screen and (min-width: 68.75em) {
.site .portfolio-entry {
margin-bottom: 1.6471em
}
.site .portfolio-entry-title,
.site .portfolio-entry-meta,
.site .portfolio-entry-content {
font-size: 1.4rem;
font-size: 14px;
}
.site .portfolio-entry-content .more-link:after {
top: 3px;
}
.site .hentry .gist .gist-file {
margin-bottom: 1.75em;
}
.site .widget .gist .gist-file {
margin-bottom: 1.3125em;
}
.hentry .fb_iframe_widget,
.hentry .googlemaps,
.hentry .PDS_Poll,
.site .hentry .presentation-wrapper,
.site .hentry .jetpack-recipe,
.site .hentry .slideshow-window,
.site .hentry .video-player {
margin-bottom: 1.6471em;
}
.site .tiled-gallery {
margin-bottom: 1.6471em;
}
.jetpack_subscription_widget #subscribe-email input {
padding: 0.5em;
}
.widget_rss_links li,
.widget_top-posts li,
.widget_upcoming_events_widget li {
padding: 0.4643em 0;
}
.jetpack-video-wrapper {
margin-bottom: 1.6471em;
}
.comment-subscription-form {
font-size: 14px;
font-size: 1.4rem;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items-visual h4.jp-relatedposts-post-title,
.hentry div#jp-relatedposts div.jp-relatedposts-items p {
font-size: 14px;
font-size: 1.4rem;
}
.jp-relatedposts-post-img {
margin-bottom: 0.6176em;
}
}
@media screen and (min-width: 77.5em) {
.site .portfolio-entry {
margin-bottom: 1.6842em
}
.site .portfolio-entry-title,
.site .portfolio-entry-meta,
.site .portfolio-entry-content {
font-size: 1.6rem;
font-size: 16px;
}
.site .portfolio-entry-content .more-link:after {
font-size: 24px;
top: 0;
}
.site .hentry .gist .gist-file {
margin-bottom: 2em;
}
.site .widget .gist .gist-file {
margin-bottom: 1.5em;
}
.hentry .fb_iframe_widget,
.hentry .googlemaps,
.hentry .PDS_Poll,
.site .hentry .presentation-wrapper,
.site .hentry .jetpack-recipe,
.site .hentry .slideshow-window,
.site .hentry .video-player {
margin-bottom: 1.6842em;
}
.widget_rss_links li,
.widget_top-posts li,
.widget_upcoming_events_widget li {
padding: 0.4688em 0;
}
.site .tiled-gallery {
margin-bottom: 1.6842em;
}
.jetpack-video-wrapper {
margin-bottom: 1.6842em;
}
.hentry div.sharedaddy h3.sd-title,
.hentry div#jp-relatedposts h3.jp-relatedposts-headline {
font-size: 13px;
font-size: 1.3rem;
}
.comment-subscription-form {
font-size: 16px;
font-size: 1.6rem;
}
.hentry div#jp-relatedposts div.jp-relatedposts-items-visual h4.jp-relatedposts-post-title,
.hentry div#jp-relatedposts div.jp-relatedposts-items p {
font-size: 16px;
font-size: 1.6rem;
line-height: 1.5em;
}
.jp-relatedposts-post-img {
margin-bottom: 0.6315em;
}
}

View file

@ -0,0 +1,28 @@
<?php
/**
* Jetpack Compatibility File
* See: http://jetpack.com/
*/
function twentyfifteen_jetpack_setup() {
/**
* Add theme support for Responsive Videos.
*/
add_theme_support( 'jetpack-responsive-videos' );
}
add_action( 'after_setup_theme', 'twentyfifteen_jetpack_setup' );
function twentyfifteen_init_jetpack() {
/**
* Add our compat CSS file for custom widget stylings and such.
* Set the version equal to filemtime for development builds, and the JETPACK__VERSION for production
* or skip it entirely for wpcom.
*/
$version = false;
if ( method_exists( 'Jetpack', 'is_development_version' ) ) {
$version = Jetpack::is_development_version() ? filemtime( plugin_dir_path( __FILE__ ) . 'twentyfifteen.css' ) : JETPACK__VERSION;
}
wp_enqueue_style( 'twentyfifteen-jetpack', plugins_url( 'twentyfifteen.css', __FILE__ ), array(), $version );
wp_style_add_data( 'twentyfifteen-jetpack', 'rtl', 'replace' );
}
add_action( 'init', 'twentyfifteen_init_jetpack' );

View file

@ -0,0 +1,367 @@
/**
* Jetpack compat stylesheet for Twenty Fourteen.
*/
#jp-post-flair:empty {
display: none;
}
.site-content #jp-post-flair {
margin: 24px 0;
}
.widget #jp-post-flair {
padding-top: 0;
}
.entry-content div.jp-relatedposts {
margin: 0;
}
div.jp-relatedposts .jp-relatedposts-headline em:after {
content: ":";
}
#page .entry-content div.sharedaddy h3,
#page .entry-summary div.sharedaddy h3,
#page .entry-content h3.sd-title,
#page .entry-summary h3.sd-title,
#primary div.sharedaddy .jp-relatedposts-headline em,
.pd-rating {
color: #767676;
font-size: 11px;
text-transform: uppercase;
}
.pd-rating {
min-height: 23px;
margin-bottom: 5px;
}
.wp-multiplayer,
.PDS_Poll,
.entry-content .slideshow-window {
margin-bottom: 24px;
}
.entry-content .gist table {
margin-bottom: 0;
}
.entry-content .slideshow-window {
border-radius: 0;
}
.entry-content .video-player {
padding: 0 0 24px;
}
.highlander-enabled #respond {
margin: 0;
padding: 0;
}
.highlander-enabled #respond h3 {
margin: 0 0 24px;
}
.highlander-enabled #respond h3 small a {
width: 24px;
}
.wpcnt {
margin-bottom: 15px; /* 24-9 */
}
#wpstats {
display: none;
}
img[id*="botd"] {
position: absolute;
}
/**
* Widgets
* -----------------------------------------------------------------------------
*/
/* About.me Widget*/
.aboutme_widget #am_thumbnail {
margin-bottom: 18px;
}
.aboutme_widget #am_thumbnail img {
border: 0;
max-width: 100%;
}
.aboutme_widget #am_name {
font-weight: 900;
margin: 0;
}
.aboutme_widget #am_headline {
font-size: 14px;
line-height: 1.2857142857;
margin: 0;
}
.aboutme_widget #am_bio {
margin: 18px 0;
}
.aboutme_widget #am_bio p {
margin-bottom: 6px;
}
.aboutme_widget #am_bio:empty {
margin: 0;
}
.aboutme_widget #am_services {
margin-top: 18px;
}
/* Akismet Widget */
.widget_akismet_widget a,
.content-sidebar .widget_akismet_widget a {
color: rgba(255,255,255,0.5) !important;
}
.widget_akismet_widget a:hover,
.content-sidebar .widget_akismet_widget a:hover {
color: rgba(255,255,255,0.7) !important;
}
/* Authors Widget */
.widget_authors li {
margin-bottom: 9px;
}
.widget_authors li:last-child {
margin-bottom: 0;
}
.widget_authors img {
margin-left: 5px;
}
/* Contact Info Widget */
.widget_contact_info > div {
margin-bottom: 18px;
}
.widget_contact_info > div:last-child {
margin-bottom: 0;
}
/* Display WordPress Posts Widget */
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts h4 {
font-size: 14px;
line-height: 1.2857142857;
margin: 0 0 9px;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts p {
font-size: 14px;
line-height: 1.2857142857 !important;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts p {
margin: 9px 0 18px !important;
}
/* Follow Button Widget */
.widget_follow_button_widget iframe {
margin-bottom: 0;
}
/* Gravatar & Gravatar Profile Widget */
.widget_gravatar img.avatar,
.widget-grofile .grofile-thumbnail {
height: auto;
max-width: 100% !important;
}
.widget-area .widget-grofile h4 {
font-size: 12px;
line-height: 1.2857142857;
margin: 18px 0 9px;
text-transform: uppercase;
}
.widget-area .widget-grofile .grofile-meta h4 {
font-size: 18px;
line-height: 1;
text-transform: none;
}
/* Image Widget */
.widget_image .wp-caption,
.widget_image .wp-caption-text {
margin-bottom: 0;
}
.widget_image img {
height: auto;
}
/* Posts I Like Widget */
.widget_jetpack_posts_i_like .widgets-list-layout li {
margin: 0;
}
/* Recent Comments Widget */
.widget_recent_comments table,
.widget_recent_comments td {
border: 0;
}
.widget_recent_comments td.recentcommentsavatartop,
.widget_recent_comments td.recentcommentsavatarend {
padding: 5px 0 5px 5px;
}
.widget_recent_comments td.recentcommentstexttop,
.widget_recent_comments td.recentcommentstextend {
padding: 5px 5px 5px 0;
vertical-align: top;
}
/* Recent Images Widget */
.widget_recent_images img {
height: auto;
}
/* Top Posts & Pages Widget */
.widget_top-posts .widgets-list-layout li {
margin-bottom: 0;
}
/* Twitter(old) Widget */
.widget_twitter li {
margin-bottom: 18px;
}
.widget_twitter li:last-child {
margin-bottom: 0;
}
.widget_twitter iframe {
margin: 18px 0 0;
}
/* List type Widgets */
.widget_jp_blogs_i_follow li,
.widget_delicious li,
.widgets-list-layout li,
.widget_top-clicks li,
.widget_top-posts li,
.top_rated li,
.widget_upcoming_events_widget .upcoming-events li {
border-top: 1px solid rgba(255, 255, 255, 0.2);
padding: 8px 0 9px;
}
.widget_jp_blogs_i_follow li:first-child,
.widgets-list-layout li:first-child,
.widget_top-clicks li:first-child,
.widget_top-posts li:first-child,
.top_rated li:first-child,
.widget_upcoming_events_widget .upcoming-events li:first-child {
border-top: 0;
}
.content-sidebar .widget_jp_blogs_i_follow li,
.content-sidebar .widgets-list-layout li,
.content-sidebar .widget_top-clicks li,
.content-sidebar .widget_top-posts li,
.content-sidebar .top_rated li,
.content-sidebar .widget_upcoming_events_widget .upcoming-events li {
border-color: rgba(0, 0, 0, 0.1);
}
.content-sidebar widget-area .widget-grofile h4 {
font-weight: 900;
}
/**
* Media Queries
* -----------------------------------------------------------------------------
*/
@media screen and (min-width: 1008px) {
.footer-sidebar .widget_jp_blogs_i_follow li,
.footer-sidebar .widget_jp_blogs_i_follow li,
.footer-sidebar .widget_top-clicks li,
.footer-sidebar .widget_top-posts li,
.footer-sidebar .top_rated li,
.footer-sidebar .widget_upcoming_events_widget .upcoming-events li,
.primary-sidebar .widget_jp_blogs_i_follow li,
.primary-sidebar .widget_jp_blogs_i_follow li,
.primary-sidebar .widget_top-clicks li,
.primary-sidebar .widget_top-posts li,
.primary-sidebar .top_rated li {
border-top: 0;
padding: 0 0 6px;
}
.footer-sidebar .widget_jp_blogs_i_follow li:last-child,
.footer-sidebar .widget_jp_blogs_i_follow li:last-child,
.footer-sidebar .widget_top-clicks li:last-child,
.footer-sidebar .widget_top-posts li:last-child,
.footer-sidebar .top_rated li:last-child,
.footer-sidebar .widget_upcoming_events_widget .upcoming-events li:last-child,
.primary-sidebar .widget_jp_blogs_i_follow li:last-child,
.primary-sidebar .widget_jp_blogs_i_follow li:last-child,
.primary-sidebar .widget_top-clicks li:last-child,
.primary-sidebar .widget_top-posts li:last-child,
.primary-sidebar .top_rated li:last-child {
padding: 0;
}
.primary-sidebar .widget_blog_subscription input[type="text"],
.footer-sidebar .widget_blog_subscription input[type="text"] {
padding: 3px 2px !important;
}
.footer-sidebar .widget_jetpack_display_posts_widget .jetpack-display-remote-posts h4,
.primary-sidebar .widget_jetpack_display_posts_widget .jetpack-display-remote-posts h4,
.footer-sidebar .widget_jetpack_display_posts_widget .jetpack-display-remote-posts p,
.primary-sidebar .widget_jetpack_display_posts_widget .jetpack-display-remote-posts p,
.footer-sidebar .widget-grofile .grofile-meta h4,
.primary-sidebar .widget-grofile .grofile-meta h4 {
font-size: 12px;
line-height: 1.5;
}
.footer-sidebar .widget_jetpack_display_posts_widget .jetpack-display-remote-posts p,
.primary-sidebar .widget_jetpack_display_posts_widget .jetpack-display-remote-posts p {
line-height: 1.5 !important;
}
.footer-sidebar .widget-grofile h4,
.primary-sidebar .widget-grofile h4,
.footer-sidebar .top_rated div > p:first-of-type,
.primary-sidebar .top_rated div > p:first-of-type {
font-size: 11px;
line-height: 1.6363636363;
}
}

View file

@ -0,0 +1,367 @@
/**
* Jetpack compat stylesheet for Twenty Fourteen.
*/
#jp-post-flair:empty {
display: none;
}
.site-content #jp-post-flair {
margin: 24px 0;
}
.widget #jp-post-flair {
padding-top: 0;
}
.entry-content div.jp-relatedposts {
margin: 0;
}
div.jp-relatedposts .jp-relatedposts-headline em:after {
content: ":";
}
#page .entry-content div.sharedaddy h3,
#page .entry-summary div.sharedaddy h3,
#page .entry-content h3.sd-title,
#page .entry-summary h3.sd-title,
#primary div.sharedaddy .jp-relatedposts-headline em,
.pd-rating {
color: #767676;
font-size: 11px;
text-transform: uppercase;
}
.pd-rating {
min-height: 23px;
margin-bottom: 5px;
}
.wp-multiplayer,
.PDS_Poll,
.entry-content .slideshow-window {
margin-bottom: 24px;
}
.entry-content .gist table {
margin-bottom: 0;
}
.entry-content .slideshow-window {
border-radius: 0;
}
.entry-content .video-player {
padding: 0 0 24px;
}
.highlander-enabled #respond {
margin: 0;
padding: 0;
}
.highlander-enabled #respond h3 {
margin: 0 0 24px;
}
.highlander-enabled #respond h3 small a {
width: 24px;
}
.wpcnt {
margin-bottom: 15px; /* 24-9 */
}
#wpstats {
display: none;
}
img[id*="botd"] {
position: absolute;
}
/**
* Widgets
* -----------------------------------------------------------------------------
*/
/* About.me Widget*/
.aboutme_widget #am_thumbnail {
margin-bottom: 18px;
}
.aboutme_widget #am_thumbnail img {
border: 0;
max-width: 100%;
}
.aboutme_widget #am_name {
font-weight: 900;
margin: 0;
}
.aboutme_widget #am_headline {
font-size: 14px;
line-height: 1.2857142857;
margin: 0;
}
.aboutme_widget #am_bio {
margin: 18px 0;
}
.aboutme_widget #am_bio p {
margin-bottom: 6px;
}
.aboutme_widget #am_bio:empty {
margin: 0;
}
.aboutme_widget #am_services {
margin-top: 18px;
}
/* Akismet Widget */
.widget_akismet_widget a,
.content-sidebar .widget_akismet_widget a {
color: rgba(255,255,255,0.5) !important;
}
.widget_akismet_widget a:hover,
.content-sidebar .widget_akismet_widget a:hover {
color: rgba(255,255,255,0.7) !important;
}
/* Authors Widget */
.widget_authors li {
margin-bottom: 9px;
}
.widget_authors li:last-child {
margin-bottom: 0;
}
.widget_authors img {
margin-right: 5px;
}
/* Contact Info Widget */
.widget_contact_info > div {
margin-bottom: 18px;
}
.widget_contact_info > div:last-child {
margin-bottom: 0;
}
/* Display WordPress Posts Widget */
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts h4 {
font-size: 14px;
line-height: 1.2857142857;
margin: 0 0 9px;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts p {
font-size: 14px;
line-height: 1.2857142857 !important;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts p {
margin: 9px 0 18px !important;
}
/* Follow Button Widget */
.widget_follow_button_widget iframe {
margin-bottom: 0;
}
/* Gravatar & Gravatar Profile Widget */
.widget_gravatar img.avatar,
.widget-grofile .grofile-thumbnail {
height: auto;
max-width: 100% !important;
}
.widget-area .widget-grofile h4 {
font-size: 12px;
line-height: 1.2857142857;
margin: 18px 0 9px;
text-transform: uppercase;
}
.widget-area .widget-grofile .grofile-meta h4 {
font-size: 18px;
line-height: 1;
text-transform: none;
}
/* Image Widget */
.widget_image .wp-caption,
.widget_image .wp-caption-text {
margin-bottom: 0;
}
.widget_image img {
height: auto;
}
/* Posts I Like Widget */
.widget_jetpack_posts_i_like .widgets-list-layout li {
margin: 0;
}
/* Recent Comments Widget */
.widget_recent_comments table,
.widget_recent_comments td {
border: 0;
}
.widget_recent_comments td.recentcommentsavatartop,
.widget_recent_comments td.recentcommentsavatarend {
padding: 5px 5px 5px 0;
}
.widget_recent_comments td.recentcommentstexttop,
.widget_recent_comments td.recentcommentstextend {
padding: 5px 0 5px 5px;
vertical-align: top;
}
/* Recent Images Widget */
.widget_recent_images img {
height: auto;
}
/* Top Posts & Pages Widget */
.widget_top-posts .widgets-list-layout li {
margin-bottom: 0;
}
/* Twitter(old) Widget */
.widget_twitter li {
margin-bottom: 18px;
}
.widget_twitter li:last-child {
margin-bottom: 0;
}
.widget_twitter iframe {
margin: 18px 0 0;
}
/* List type Widgets */
.widget_jp_blogs_i_follow li,
.widget_delicious li,
.widgets-list-layout li,
.widget_top-clicks li,
.widget_top-posts li,
.top_rated li,
.widget_upcoming_events_widget .upcoming-events li {
border-top: 1px solid rgba(255, 255, 255, 0.2);
padding: 8px 0 9px;
}
.widget_jp_blogs_i_follow li:first-child,
.widgets-list-layout li:first-child,
.widget_top-clicks li:first-child,
.widget_top-posts li:first-child,
.top_rated li:first-child,
.widget_upcoming_events_widget .upcoming-events li:first-child {
border-top: 0;
}
.content-sidebar .widget_jp_blogs_i_follow li,
.content-sidebar .widgets-list-layout li,
.content-sidebar .widget_top-clicks li,
.content-sidebar .widget_top-posts li,
.content-sidebar .top_rated li,
.content-sidebar .widget_upcoming_events_widget .upcoming-events li {
border-color: rgba(0, 0, 0, 0.1);
}
.content-sidebar widget-area .widget-grofile h4 {
font-weight: 900;
}
/**
* Media Queries
* -----------------------------------------------------------------------------
*/
@media screen and (min-width: 1008px) {
.footer-sidebar .widget_jp_blogs_i_follow li,
.footer-sidebar .widget_jp_blogs_i_follow li,
.footer-sidebar .widget_top-clicks li,
.footer-sidebar .widget_top-posts li,
.footer-sidebar .top_rated li,
.footer-sidebar .widget_upcoming_events_widget .upcoming-events li,
.primary-sidebar .widget_jp_blogs_i_follow li,
.primary-sidebar .widget_jp_blogs_i_follow li,
.primary-sidebar .widget_top-clicks li,
.primary-sidebar .widget_top-posts li,
.primary-sidebar .top_rated li {
border-top: 0;
padding: 0 0 6px;
}
.footer-sidebar .widget_jp_blogs_i_follow li:last-child,
.footer-sidebar .widget_jp_blogs_i_follow li:last-child,
.footer-sidebar .widget_top-clicks li:last-child,
.footer-sidebar .widget_top-posts li:last-child,
.footer-sidebar .top_rated li:last-child,
.footer-sidebar .widget_upcoming_events_widget .upcoming-events li:last-child,
.primary-sidebar .widget_jp_blogs_i_follow li:last-child,
.primary-sidebar .widget_jp_blogs_i_follow li:last-child,
.primary-sidebar .widget_top-clicks li:last-child,
.primary-sidebar .widget_top-posts li:last-child,
.primary-sidebar .top_rated li:last-child {
padding: 0;
}
.primary-sidebar .widget_blog_subscription input[type="text"],
.footer-sidebar .widget_blog_subscription input[type="text"] {
padding: 3px 2px !important;
}
.footer-sidebar .widget_jetpack_display_posts_widget .jetpack-display-remote-posts h4,
.primary-sidebar .widget_jetpack_display_posts_widget .jetpack-display-remote-posts h4,
.footer-sidebar .widget_jetpack_display_posts_widget .jetpack-display-remote-posts p,
.primary-sidebar .widget_jetpack_display_posts_widget .jetpack-display-remote-posts p,
.footer-sidebar .widget-grofile .grofile-meta h4,
.primary-sidebar .widget-grofile .grofile-meta h4 {
font-size: 12px;
line-height: 1.5;
}
.footer-sidebar .widget_jetpack_display_posts_widget .jetpack-display-remote-posts p,
.primary-sidebar .widget_jetpack_display_posts_widget .jetpack-display-remote-posts p {
line-height: 1.5 !important;
}
.footer-sidebar .widget-grofile h4,
.primary-sidebar .widget-grofile h4,
.footer-sidebar .top_rated div > p:first-of-type,
.primary-sidebar .top_rated div > p:first-of-type {
font-size: 11px;
line-height: 1.6363636363;
}
}

View file

@ -0,0 +1,71 @@
<?php
/**
* A last try to show posts, in case the Featured Content plugin returns no IDs.
*
* @param array $featured_ids
* @return array
*/
function twentyfourteen_featured_content_post_ids( $featured_ids ) {
if ( empty( $featured_ids ) ) {
$featured_ids = array_slice( get_option( 'sticky_posts', array() ), 0, 6 );
}
return $featured_ids;
}
add_action( 'featured_content_post_ids', 'twentyfourteen_featured_content_post_ids' );
/**
* Set the default tag name for Featured Content.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
* @return void
*/
function twentyfourteen_customizer_default( $wp_customize ) {
$wp_customize->get_setting( 'featured-content[tag-name]' )->default = 'featured';
}
add_action( 'customize_register', 'twentyfourteen_customizer_default' );
/**
* Sets a default tag of 'featured' for Featured Content.
*
* @param array $settings
* @return array
*/
function twentyfourteen_featured_content_default_settings( $settings ) {
$settings['tag-name'] = 'featured';
return $settings;
}
add_action( 'featured_content_default_settings', 'twentyfourteen_featured_content_default_settings' );
/**
* Removes sharing markup from post content if we're not in the loop and it's a
* formatted post.
*
* @param bool $show Whether to show sharing options.
* @param WP_Post $post The post to share.
* @return bool
*/
function twentyfourteen_mute_content_filters( $show, $post ) {
$formats = get_theme_support( 'post-formats' );
if ( ! in_the_loop() && has_post_format( $formats[0], $post ) ) {
$show = false;
}
return $show;
}
add_filter( 'sharing_show', 'twentyfourteen_mute_content_filters', 10, 2 );
function twentyfourteen_init_jetpack() {
/**
* Add our compat CSS file for custom widget stylings and such.
* Set the version equal to filemtime for development builds, and the JETPACK__VERSION for production.
*/
$version = false;
if ( method_exists( 'Jetpack', 'is_development_version' ) ) {
$version = Jetpack::is_development_version() ? filemtime( plugin_dir_path( __FILE__ ) . 'twentyfourteen.css' ) : JETPACK__VERSION;
}
wp_enqueue_style( 'twentyfourteen-jetpack', plugins_url( 'twentyfourteen.css', __FILE__ ), array(), $version );
wp_style_add_data( 'twentyfourteen-jetpack', 'rtl', 'replace' );
}
add_action( 'init', 'twentyfourteen_init_jetpack' );

View file

@ -0,0 +1,763 @@
/**
* Jetpack Comments
*/
.comment-form iframe {
margin: 0;
}
.comment-form .subscribe-label {
font-weight: 400;
letter-spacing: 0;
text-transform: none;
}
.comment-subscription-form {
margin: 1.75em 0 0;
}
.comment-subscription-form + .comment-subscription-form {
margin-top: 0;
}
/**
* Extra Widgets
*/
/* Blog Subscriptions Widget */
.jetpack_subscription_widget #subscribe-email input {
padding: 0.625em 0.4375em;
width: 100%;
}
.jetpack_subscription_widget form > :last-child {
margin-bottom: 0;
}
/* Contact Info Widget */
.widget_contact_info .contact-map {
margin-bottom: 1.75em;
}
/* Display WordPress Posts Widget */
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts {
margin: 0;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts h4 {
font-size: inherit;
margin: 0 0 0.875em;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts img {
margin-bottom: 0.875em;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts p {
font-size: inherit;
line-height: 1.75 !important;
margin: 0 0 1.75em !important;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts > :last-child {
margin-bottom: 0 !important;
}
/* Gallery Widget */
.widget-gallery .slideshow-window {
border-radius: 0;
}
/* Goodreads Widget */
.widget_goodreads div[class^="gr_custom_container"] {
background-color: transparent;
border: 0;
border-radius: 0;
color: inherit;
padding: 0;
}
.widget_goodreads div[class^="gr_custom_container"] a {
color: inherit;
}
.widget_goodreads div[class^="gr_custom_each_container"] {
border: 0;
margin-bottom: 1.75em;
padding-bottom: 0;
}
.widget_goodreads h2[class^="gr_custom_header"],
.widget_goodreads div[class^="gr_custom_author"] {
font-size: inherit;
}
/* Gravatar Profile Widget */
.widget-grofile .grofile-thumbnail {
width: 300px;
}
.widget-area .widget-grofile h4 {
font-size: inherit;
font-weight: 900;
margin: 1.75em 0 0;
}
.widget-area .widget-grofile .grofile-accounts {
margin-top: 0.4375em;
}
/* Image Widget */
.widget_image .wp-caption {
margin-bottom: 0;
}
/* RSS Links Widget */
.widget_rss_links img {
position: relative;
top: -1px;
}
/* Social Media Icon Widget */
.widget.widget_wpcom_social_media_icons_widget ul {
margin: 0 0 -0.4375em;
}
.widget.widget_wpcom_social_media_icons_widget ul:before,
.widget.widget_wpcom_social_media_icons_widget ul:after {
content: "";
display: table;
}
.widget.widget_wpcom_social_media_icons_widget ul:after {
clear: both;
}
.widget.widget_wpcom_social_media_icons_widget li {
float: right;
margin: 0 0 0.4375em 0.4375em;
}
.widget.widget_wpcom_social_media_icons_widget li a {
border: 1px solid currentColor;
border-radius: 50%;
color: inherit;
display: block;
height: 35px;
position: relative;
width: 35px;
}
.widget.widget_wpcom_social_media_icons_widget li a:before {
height: 33px;
line-height: 33px;
text-align: center;
width: 33px;
}
.widget.widget_wpcom_social_media_icons_widget li a:hover:before,
.widget.widget_wpcom_social_media_icons_widget li a:focus:before {
opacity: 0.8;
}
/* Top Posts & Pages Widget */
.widget_top-posts .widgets-list-layout .widgets-list-layout-blavatar {
margin-top: 0.25em;
}
.widget_top-posts .widgets-list-layout-links {
width: -webkit-calc(100% - 3.375em);
width: calc(100% - 3.375em);
}
.widget_top-posts .widgets-list-layout li {
margin-bottom: 0.875em;
}
.widget_top-posts .widgets-list-layout li:last-child {
margin-bottom: 0;
}
.widget-grid-view-image:nth-child(odd) {
clear: both;
}
/* Upcoming Events Widget */
.widget_upcoming_events_widget .upcoming-events li {
margin-bottom: 0.875em
}
/**
* Shortcodes
*/
/* Contact Form */
.entry-content .contact-form label {
color: inherit;
display: block;
font-family: Montserrat, "Helvetica Neue", sans-serif;
font-size: 13px;
font-size: 0.8125rem;
font-weight: 400;
letter-spacing: 0.076923077em;
line-height: 1.6153846154;
margin-bottom: 0.5384615385em;
text-transform: uppercase;
}
.entry-content .contact-form label span {
color: inherit;
letter-spacing: 0;
opacity: 0.7;
text-transform: capitalize;
}
.entry-content .contact-form input[type="text"],
.entry-content .contact-form input[type="email"],
.entry-content .contact-form textarea {
margin-bottom: 1.75em;
max-width: 100%;
width: 100%;
}
.entry-content .contact-form label.checkbox,
.entry-content .contact-form label.radio {
font-family: inherit;
font-size: inherit;
letter-spacing: 0;
margin-bottom: 0;
text-transform: none;
}
.entry-content .contact-form label.checkbox:nth-last-child(2),
.entry-content .contact-form label.radio:nth-last-child(2) {
margin-bottom: 0.875em;
}
.entry-content .contact-form input[type="radio"],
.entry-content .contact-form input[type="checkbox"] {
margin-bottom: 0.875em;
}
.entry-content .contact-form select {
margin-bottom: 1.75em;
}
/* Facebook */
.fb_iframe_widget {
margin-bottom: 1.75em;
max-width: 100%;
}
.fb_iframe_widget span {
max-width: 100%;
}
/* Gist */
.gist table {
table-layout: auto;
}
.entry-content .gist .gist-file {
margin-bottom: 1.75em;
}
/* Instagram */
.instagram-media {
margin-bottom: 1.75em !important;
}
/* Mixclound */
iframe[src^="http://api.mixcloud.com/"] {
margin-right: -8px;
max-width: -webkit-calc(100% + 8px);
max-width: calc(100% + 8px);
}
/* Polldaddy */
.PDS_Poll {
display: block !important;
margin-bottom: 1.75em;
}
.PDS_Poll .pds-box {
max-width: 100%;
width: auto;
}
/* Portfolio */
.entry-content .portfolio-entry {
margin-bottom: 1.75em;
}
.entry-content .portfolio-entry-title,
.entry-content .portfolio-entry-meta {
font-family: Montserrat, "Helvetica Neue", sans-serif;
}
.entry-content .portfolio-entry-title a,
.entry-content .portfolio-entry-meta a {
box-shadow: none;
}
.entry-content .portfolio-entry-title a:hover,
.entry-content .portfolio-entry-meta a:hover {
box-shadow: 0 1px 0 0 currentColor;
}
.entry-content .portfolio-entry-meta span,
.entry-content .portfolio-entry-meta a {
font-size: 1em;
}
.entry-content .portfolio-entry-title {
font-size: inherit;
line-height: 1.3125;
}
.entry-content .portfolio-featured-image + .portfolio-entry-title {
margin-top: 0.875em;
margin-bottom: 0.4375em;
}
.entry-content .portfolio-entry-meta,
.entry-content .portfolio-entry-content p {
font-size: 13px;
font-size: 0.8125em;
line-height: 1.615384615;
}
.entry-content .portfolio-entry-content p:last-child {
margin-bottom: 0;
}
.entry-content .portfolio-entry-title + .portfolio-entry-meta {
margin-top: 0.538461538em;
}
.entry-content .portfolio-entry-content {
margin-top: 0.875em;
}
.entry-content .portfolio-entry-content p {
margin-bottom: 1.615384615em;
}
/* Presentation */
.entry-content .presentation-wrapper {
margin: 0 0 1.75em;
max-width: 100%;
}
.presentation {
max-width: 100%;
}
/* Recipes */
.entry-content .jetpack-recipe {
border: 0;
margin: 0 0 1.75em;
padding: 0;
}
.entry-content .jetpack-recipe-title {
border: 0;
margin-top: 0;
padding: 0;
}
.entry-content .jetpack-recipe .jetpack-recipe-meta {
font-size: inherit;
margin: 0;
}
/* Scribd */
.scribd_iframe_embed + div {
margin-bottom: 28px;
}
/* Slideshow */
.entry-content .slideshow-window {
border-radius: 0;
margin-bottom: 1.75em;
}
/* Subscription Form */
.entry-content .jetpack_subscription_widget {
border-top: 0;
font-size: inherit;
margin-bottom: 1.75em;
padding: 0;
}
.entry-content #subscribe-email input {
font-size: inherit;
line-height: normal;
padding: 0.625em 0.4375em;
width: 100%;
}
.entry-content .jetpack_subscription_widget input[type="submit"] {
font-size: inherit;
padding: 0.84375em 0.875em 0.78125em;
}
/* Testimonial */
.entry-content .testimonial-entry {
margin-bottom: 1.75em;
}
.entry-content .testimonial-entry-content {
margin: 0;
}
.entry-content .testimonial-entry-title,
.entry-content .testimonial-entry-content p {
font-size: 13px;
font-size: 0.8125em;
line-height: 1.615384615;
margin: 0;
}
.entry-content .testimonial-entry-content p {
margin-bottom: 1.615384615em;
}
.entry-content .testimonial-entry-title {
float: right;
}
.entry-content .testimonial-entry-title a {
box-shadow: none;
}
.entry-content .testimonial-entry-title a:hover {
box-shadow: 0 1px 0 0 currentColor;
}
.entry-content .testimonial-featured-image img {
float: left;
max-width: 42px;
}
/* Twitter-timeline */
.twitter-timeline {
margin-bottom: 1.75em !important;
}
/**
* Responsive Videos
*/
.hentry .jetpack-video-wrapper {
margin-bottom: 1.75em;
}
/**
* Related Posts
*/
.entry-content #jp-relatedposts {
margin: 0;
padding: 1.75em 0;
position: relative;
}
.jp-relatedposts:before,
.jp-relatedposts:last-child:after {
background-color: currentColor;
content: "";
height: 1px;
opacity: 0.2;
position: absolute;
top: 0;
width: 100%;
}
.jp-relatedposts:last-child:after {
bottom: 0;
top: auto;
}
.entry-content #jp-relatedposts h3.jp-relatedposts-headline {
color: inherit;
font-family: Montserrat, "Helvetica Neue", sans-serif;
font-size: 13px;
font-size: 0.8125rem;
font-weight: 400;
line-height: 1;
margin-bottom: 1.076923077em;
}
.entry-content #jp-relatedposts h3.jp-relatedposts-headline em:before {
display: none;
}
.entry-content #jp-relatedposts h3.jp-relatedposts-headline em {
font-weight: 400;
}
.entry-content #jp-relatedposts .jp-relatedposts-headline em:after {
content: ":";
}
.jp-relatedposts-items:before,
.jp-relatedposts-items:after {
content: "";
display: table;
}
.jp-relatedposts-items:after {
clear: both;
}
.entry-content .jp-relatedposts-post-aoverlay,
.entry-content .jp-relatedposts-post-a {
box-shadow: none;
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post {
margin-bottom: 1.75em;
width: 100%;
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:last-child {
margin-bottom: 0;
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post span {
max-width: 100%;
}
.entry-content #jp-relatedposts .jp-relatedposts-items p,
.entry-content #jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title {
font-size: 13px;
font-size: 0.8125rem;
letter-spacing: 0;
line-height: 1.615384615;
}
.jp-relatedposts-post-date,
.jp-relatedposts-post-context {
font-family: Montserrat, "Helvetica Neue", sans-serif;
}
.jp-relatedposts-post-title,
#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post-excerpt,
.entry-content #jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title {
margin-bottom: 1.076923077em;
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a {
font-weight: 700;
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a:hover,
.entry-content .jp-relatedposts-post-aoverlay:hover + .jp-relatedposts-post-title .jp-relatedposts-post-a {
box-shadow: 0 1px 0 0 currentColor;
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a:hover,
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:hover .jp-relatedposts-post-title a {
text-decoration: none;
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-date,
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-context,
.entry-content #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post {
opacity: 1;
}
.entry-content #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post {
padding-left: 0;
}
.entry-content .jp-relatedposts-post-a:hover img.jp-relatedposts-post-img,
.entry-content .jp-relatedposts-post-a:focus img.jp-relatedposts-post-img {
opacity: 0.85;
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post img.jp-relatedposts-post-img {
margin-bottom: 0.875em;
max-width: 100%;
}
/**
* Sharing
*/
.sharedaddy {
padding: 1.75em 0;
position: relative;
}
.sharedaddy:before,
.sharedaddy:last-child:after {
background-color: currentColor;
content: "";
height: 1px;
opacity: 0.2;
position: absolute;
top: 0;
width: 100%;
}
.sharedaddy:last-child:after {
bottom: 0;
top: auto;
}
.sd-block {
line-height: 1;
}
.sd-like {
padding-bottom: 1.125em;
}
.hentry div.sharedaddy h3.sd-title,
.hentry h3.sd-title {
color: inherit;
font-family: Montserrat, "Helvetica Neue", sans-serif;
font-size: 13px;
font-size: 0.8125rem;
font-weight: 400;
line-height: 1;
margin-bottom: 1.076923077em;
}
.hentry div.sharedaddy h3.sd-title:before {
display: none;
}
.sd-social-icon-text .sd-content ul,
.sd-social-text .sd-content ul {
margin-bottom: -0.3125em !important;
}
.sd-social-icon .sd-content ul {
margin-bottom: 0 !important;
}
.sd-social-official .sd-content ul {
margin-bottom: -0.625em !important;
}
.hentry #sharing_email .sharing_send,
.hentry .sd-content ul li .option a.share-ustom,
.hentry .sd-content ul li a.sd-button,
.hentry .sd-content ul li.advanced a.share-more,
.hentry .sd-content ul li.preview-item div.option.option-smart-off a,
.hentry .sd-social-icon .sd-content ul li a.sd-button,
.hentry .sd-social-icon-text .sd-content ul li a.sd-button,
.hentry .sd-social-official .sd-content > ul > li .digg_button > a,
.hentry .sd-social-official .sd-content > ul > li > a.sd-button,
.hentry .sd-social-text .sd-content ul li a.sd-button {
box-shadow: none;
}
/**
* Stats
*/
#wpstats {
display: none;
}
/**
* Tiled gallery
*/
.entry-content .tiled-gallery {
margin-bottom: 1.75em;
}
/**
* Media Queries
*/
@media screen and (min-width: 56.875em) {
.widget-area .jetpack_subscription_widget #subscribe-email input {
padding: 0.4615384615em 0.5384615385em;
}
.widget_contact_info .contact-map {
margin-bottom: 1.615384615em;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts h4,
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts img {
margin-bottom: 1.076923077em;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts p {
line-height: 1.615384615em !important;
margin: 0 0 1.615384615em !important;
}
.widget_goodreads div[class^="gr_custom_each_container"] {
margin-bottom: 1.615384615em;
}
.widget-area .widget-grofile h4 {
margin: 1.615384615em 0 0;
}
.widget-area .widget-grofile .grofile-accounts {
margin-top: 0.538461538em;
}
.widget.widget_wpcom_social_media_icons_widget ul {
margin: 0 0 -0.538461538em;
}
.widget.widget_wpcom_social_media_icons_widget li {
margin: 0 0 0.538461538em 0.538461538em;
}
.widget_top-posts .widgets-list-layout .widgets-list-layout-blavatar {
margin-top: 0.153846154em;
}
.widget_top-posts .widgets-list-layout-links {
width: -webkit-calc(100% - 4.153846154em);
width: calc(100% - 4.153846154em);
}
.widget_top-posts .widgets-list-layout li {
margin-bottom: 1.076923077em;
}
.widget_upcoming_events_widget .upcoming-events li {
margin-bottom: 1.076923077em
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post {
margin-bottom: 0;
padding-left: 0.875em;
width: 33%;
}
}
@media screen and (min-width: 61.5625em) {
body:not(.search-results) article:not(.type-page) .sharedaddy:last-child,
body:not(.search-results) article:not(.type-page) .jp-relatedposts:last-child {
padding-bottom: 0;
}
body:not(.search-results) article:not(.type-page) .sharedaddy:last-child:after,
body:not(.search-results) article:not(.type-page) .jp-relatedposts:last-child:after {
display: none;
}
body:not(.search-results) article:not(.type-page) img.below-entry-meta {
width: auto;
}
}

View file

@ -0,0 +1,763 @@
/**
* Jetpack Comments
*/
.comment-form iframe {
margin: 0;
}
.comment-form .subscribe-label {
font-weight: 400;
letter-spacing: 0;
text-transform: none;
}
.comment-subscription-form {
margin: 1.75em 0 0;
}
.comment-subscription-form + .comment-subscription-form {
margin-top: 0;
}
/**
* Extra Widgets
*/
/* Blog Subscriptions Widget */
.jetpack_subscription_widget #subscribe-email input {
padding: 0.625em 0.4375em;
width: 100%;
}
.jetpack_subscription_widget form > :last-child {
margin-bottom: 0;
}
/* Contact Info Widget */
.widget_contact_info .contact-map {
margin-bottom: 1.75em;
}
/* Display WordPress Posts Widget */
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts {
margin: 0;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts h4 {
font-size: inherit;
margin: 0 0 0.875em;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts img {
margin-bottom: 0.875em;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts p {
font-size: inherit;
line-height: 1.75 !important;
margin: 0 0 1.75em !important;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts > :last-child {
margin-bottom: 0 !important;
}
/* Gallery Widget */
.widget-gallery .slideshow-window {
border-radius: 0;
}
/* Goodreads Widget */
.widget_goodreads div[class^="gr_custom_container"] {
background-color: transparent;
border: 0;
border-radius: 0;
color: inherit;
padding: 0;
}
.widget_goodreads div[class^="gr_custom_container"] a {
color: inherit;
}
.widget_goodreads div[class^="gr_custom_each_container"] {
border: 0;
margin-bottom: 1.75em;
padding-bottom: 0;
}
.widget_goodreads h2[class^="gr_custom_header"],
.widget_goodreads div[class^="gr_custom_author"] {
font-size: inherit;
}
/* Gravatar Profile Widget */
.widget-grofile .grofile-thumbnail {
width: 300px;
}
.widget-area .widget-grofile h4 {
font-size: inherit;
font-weight: 900;
margin: 1.75em 0 0;
}
.widget-area .widget-grofile .grofile-accounts {
margin-top: 0.4375em;
}
/* Image Widget */
.widget_image .wp-caption {
margin-bottom: 0;
}
/* RSS Links Widget */
.widget_rss_links img {
position: relative;
top: -1px;
}
/* Social Media Icon Widget */
.widget.widget_wpcom_social_media_icons_widget ul {
margin: 0 0 -0.4375em;
}
.widget.widget_wpcom_social_media_icons_widget ul:before,
.widget.widget_wpcom_social_media_icons_widget ul:after {
content: "";
display: table;
}
.widget.widget_wpcom_social_media_icons_widget ul:after {
clear: both;
}
.widget.widget_wpcom_social_media_icons_widget li {
float: left;
margin: 0 0.4375em 0.4375em 0;
}
.widget.widget_wpcom_social_media_icons_widget li a {
border: 1px solid currentColor;
border-radius: 50%;
color: inherit;
display: block;
height: 35px;
position: relative;
width: 35px;
}
.widget.widget_wpcom_social_media_icons_widget li a:before {
height: 33px;
line-height: 33px;
text-align: center;
width: 33px;
}
.widget.widget_wpcom_social_media_icons_widget li a:hover:before,
.widget.widget_wpcom_social_media_icons_widget li a:focus:before {
opacity: 0.8;
}
/* Top Posts & Pages Widget */
.widget_top-posts .widgets-list-layout .widgets-list-layout-blavatar {
margin-top: 0.25em;
}
.widget_top-posts .widgets-list-layout-links {
width: -webkit-calc(100% - 3.375em);
width: calc(100% - 3.375em);
}
.widget_top-posts .widgets-list-layout li {
margin-bottom: 0.875em;
}
.widget_top-posts .widgets-list-layout li:last-child {
margin-bottom: 0;
}
.widget-grid-view-image:nth-child(odd) {
clear: both;
}
/* Upcoming Events Widget */
.widget_upcoming_events_widget .upcoming-events li {
margin-bottom: 0.875em
}
/**
* Shortcodes
*/
/* Contact Form */
.entry-content .contact-form label {
color: inherit;
display: block;
font-family: Montserrat, "Helvetica Neue", sans-serif;
font-size: 13px;
font-size: 0.8125rem;
font-weight: 400;
letter-spacing: 0.076923077em;
line-height: 1.6153846154;
margin-bottom: 0.5384615385em;
text-transform: uppercase;
}
.entry-content .contact-form label span {
color: inherit;
letter-spacing: 0;
opacity: 0.7;
text-transform: capitalize;
}
.entry-content .contact-form input[type="text"],
.entry-content .contact-form input[type="email"],
.entry-content .contact-form textarea {
margin-bottom: 1.75em;
max-width: 100%;
width: 100%;
}
.entry-content .contact-form label.checkbox,
.entry-content .contact-form label.radio {
font-family: inherit;
font-size: inherit;
letter-spacing: 0;
margin-bottom: 0;
text-transform: none;
}
.entry-content .contact-form label.checkbox:nth-last-child(2),
.entry-content .contact-form label.radio:nth-last-child(2) {
margin-bottom: 0.875em;
}
.entry-content .contact-form input[type="radio"],
.entry-content .contact-form input[type="checkbox"] {
margin-bottom: 0.875em;
}
.entry-content .contact-form select {
margin-bottom: 1.75em;
}
/* Facebook */
.fb_iframe_widget {
margin-bottom: 1.75em;
max-width: 100%;
}
.fb_iframe_widget span {
max-width: 100%;
}
/* Gist */
.gist table {
table-layout: auto;
}
.entry-content .gist .gist-file {
margin-bottom: 1.75em;
}
/* Instagram */
.instagram-media {
margin-bottom: 1.75em !important;
}
/* Mixclound */
iframe[src^="http://api.mixcloud.com/"] {
margin-left: -8px;
max-width: -webkit-calc(100% + 8px);
max-width: calc(100% + 8px);
}
/* Polldaddy */
.PDS_Poll {
display: block !important;
margin-bottom: 1.75em;
}
.PDS_Poll .pds-box {
max-width: 100%;
width: auto;
}
/* Portfolio */
.entry-content .portfolio-entry {
margin-bottom: 1.75em;
}
.entry-content .portfolio-entry-title,
.entry-content .portfolio-entry-meta {
font-family: Montserrat, "Helvetica Neue", sans-serif;
}
.entry-content .portfolio-entry-title a,
.entry-content .portfolio-entry-meta a {
box-shadow: none;
}
.entry-content .portfolio-entry-title a:hover,
.entry-content .portfolio-entry-meta a:hover {
box-shadow: 0 1px 0 0 currentColor;
}
.entry-content .portfolio-entry-meta span,
.entry-content .portfolio-entry-meta a {
font-size: 1em;
}
.entry-content .portfolio-entry-title {
font-size: inherit;
line-height: 1.3125;
}
.entry-content .portfolio-featured-image + .portfolio-entry-title {
margin-top: 0.875em;
margin-bottom: 0.4375em;
}
.entry-content .portfolio-entry-meta,
.entry-content .portfolio-entry-content p {
font-size: 13px;
font-size: 0.8125em;
line-height: 1.615384615;
}
.entry-content .portfolio-entry-content p:last-child {
margin-bottom: 0;
}
.entry-content .portfolio-entry-title + .portfolio-entry-meta {
margin-top: 0.538461538em;
}
.entry-content .portfolio-entry-content {
margin-top: 0.875em;
}
.entry-content .portfolio-entry-content p {
margin-bottom: 1.615384615em;
}
/* Presentation */
.entry-content .presentation-wrapper {
margin: 0 0 1.75em;
max-width: 100%;
}
.presentation {
max-width: 100%;
}
/* Recipes */
.entry-content .jetpack-recipe {
border: 0;
margin: 0 0 1.75em;
padding: 0;
}
.entry-content .jetpack-recipe-title {
border: 0;
margin-top: 0;
padding: 0;
}
.entry-content .jetpack-recipe .jetpack-recipe-meta {
font-size: inherit;
margin: 0;
}
/* Scribd */
.scribd_iframe_embed + div {
margin-bottom: 28px;
}
/* Slideshow */
.entry-content .slideshow-window {
border-radius: 0;
margin-bottom: 1.75em;
}
/* Subscription Form */
.entry-content .jetpack_subscription_widget {
border-top: 0;
font-size: inherit;
margin-bottom: 1.75em;
padding: 0;
}
.entry-content #subscribe-email input {
font-size: inherit;
line-height: normal;
padding: 0.625em 0.4375em;
width: 100%;
}
.entry-content .jetpack_subscription_widget input[type="submit"] {
font-size: inherit;
padding: 0.84375em 0.875em 0.78125em;
}
/* Testimonial */
.entry-content .testimonial-entry {
margin-bottom: 1.75em;
}
.entry-content .testimonial-entry-content {
margin: 0;
}
.entry-content .testimonial-entry-title,
.entry-content .testimonial-entry-content p {
font-size: 13px;
font-size: 0.8125em;
line-height: 1.615384615;
margin: 0;
}
.entry-content .testimonial-entry-content p {
margin-bottom: 1.615384615em;
}
.entry-content .testimonial-entry-title {
float: left;
}
.entry-content .testimonial-entry-title a {
box-shadow: none;
}
.entry-content .testimonial-entry-title a:hover {
box-shadow: 0 1px 0 0 currentColor;
}
.entry-content .testimonial-featured-image img {
float: right;
max-width: 42px;
}
/* Twitter-timeline */
.twitter-timeline {
margin-bottom: 1.75em !important;
}
/**
* Responsive Videos
*/
.hentry .jetpack-video-wrapper {
margin-bottom: 1.75em;
}
/**
* Related Posts
*/
.entry-content #jp-relatedposts {
margin: 0;
padding: 1.75em 0;
position: relative;
}
.jp-relatedposts:before,
.jp-relatedposts:last-child:after {
background-color: currentColor;
content: "";
height: 1px;
opacity: 0.2;
position: absolute;
top: 0;
width: 100%;
}
.jp-relatedposts:last-child:after {
bottom: 0;
top: auto;
}
.entry-content #jp-relatedposts h3.jp-relatedposts-headline {
color: inherit;
font-family: Montserrat, "Helvetica Neue", sans-serif;
font-size: 13px;
font-size: 0.8125rem;
font-weight: 400;
line-height: 1;
margin-bottom: 1.076923077em;
}
.entry-content #jp-relatedposts h3.jp-relatedposts-headline em:before {
display: none;
}
.entry-content #jp-relatedposts h3.jp-relatedposts-headline em {
font-weight: 400;
}
.entry-content #jp-relatedposts .jp-relatedposts-headline em:after {
content: ":";
}
.jp-relatedposts-items:before,
.jp-relatedposts-items:after {
content: "";
display: table;
}
.jp-relatedposts-items:after {
clear: both;
}
.entry-content .jp-relatedposts-post-aoverlay,
.entry-content .jp-relatedposts-post-a {
box-shadow: none;
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post {
margin-bottom: 1.75em;
width: 100%;
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:last-child {
margin-bottom: 0;
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post span {
max-width: 100%;
}
.entry-content #jp-relatedposts .jp-relatedposts-items p,
.entry-content #jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title {
font-size: 13px;
font-size: 0.8125rem;
letter-spacing: 0;
line-height: 1.615384615;
}
.jp-relatedposts-post-date,
.jp-relatedposts-post-context {
font-family: Montserrat, "Helvetica Neue", sans-serif;
}
.jp-relatedposts-post-title,
#jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post-excerpt,
.entry-content #jp-relatedposts .jp-relatedposts-items-visual h4.jp-relatedposts-post-title {
margin-bottom: 1.076923077em;
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a {
font-weight: 700;
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a:hover,
.entry-content .jp-relatedposts-post-aoverlay:hover + .jp-relatedposts-post-title .jp-relatedposts-post-a {
box-shadow: 0 1px 0 0 currentColor;
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-title a:hover,
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post:hover .jp-relatedposts-post-title a {
text-decoration: none;
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-date,
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post .jp-relatedposts-post-context,
.entry-content #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post {
opacity: 1;
}
.entry-content #jp-relatedposts .jp-relatedposts-items-visual .jp-relatedposts-post {
padding-right: 0;
}
.entry-content .jp-relatedposts-post-a:hover img.jp-relatedposts-post-img,
.entry-content .jp-relatedposts-post-a:focus img.jp-relatedposts-post-img {
opacity: 0.85;
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post img.jp-relatedposts-post-img {
margin-bottom: 0.875em;
max-width: 100%;
}
/**
* Sharing
*/
.sharedaddy {
padding: 1.75em 0;
position: relative;
}
.sharedaddy:before,
.sharedaddy:last-child:after {
background-color: currentColor;
content: "";
height: 1px;
opacity: 0.2;
position: absolute;
top: 0;
width: 100%;
}
.sharedaddy:last-child:after {
bottom: 0;
top: auto;
}
.sd-block {
line-height: 1;
}
.sd-like {
padding-bottom: 1.125em;
}
.hentry div.sharedaddy h3.sd-title,
.hentry h3.sd-title {
color: inherit;
font-family: Montserrat, "Helvetica Neue", sans-serif;
font-size: 13px;
font-size: 0.8125rem;
font-weight: 400;
line-height: 1;
margin-bottom: 1.076923077em;
}
.hentry div.sharedaddy h3.sd-title:before {
display: none;
}
.sd-social-icon-text .sd-content ul,
.sd-social-text .sd-content ul {
margin-bottom: -0.3125em !important;
}
.sd-social-icon .sd-content ul {
margin-bottom: 0 !important;
}
.sd-social-official .sd-content ul {
margin-bottom: -0.625em !important;
}
.hentry #sharing_email .sharing_send,
.hentry .sd-content ul li .option a.share-ustom,
.hentry .sd-content ul li a.sd-button,
.hentry .sd-content ul li.advanced a.share-more,
.hentry .sd-content ul li.preview-item div.option.option-smart-off a,
.hentry .sd-social-icon .sd-content ul li a.sd-button,
.hentry .sd-social-icon-text .sd-content ul li a.sd-button,
.hentry .sd-social-official .sd-content > ul > li .digg_button > a,
.hentry .sd-social-official .sd-content > ul > li > a.sd-button,
.hentry .sd-social-text .sd-content ul li a.sd-button {
box-shadow: none;
}
/**
* Stats
*/
#wpstats {
display: none;
}
/**
* Tiled gallery
*/
.entry-content .tiled-gallery {
margin-bottom: 1.75em;
}
/**
* Media Queries
*/
@media screen and (min-width: 56.875em) {
.widget-area .jetpack_subscription_widget #subscribe-email input {
padding: 0.4615384615em 0.5384615385em;
}
.widget_contact_info .contact-map {
margin-bottom: 1.615384615em;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts h4,
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts img {
margin-bottom: 1.076923077em;
}
.widget_jetpack_display_posts_widget .jetpack-display-remote-posts p {
line-height: 1.615384615em !important;
margin: 0 0 1.615384615em !important;
}
.widget_goodreads div[class^="gr_custom_each_container"] {
margin-bottom: 1.615384615em;
}
.widget-area .widget-grofile h4 {
margin: 1.615384615em 0 0;
}
.widget-area .widget-grofile .grofile-accounts {
margin-top: 0.538461538em;
}
.widget.widget_wpcom_social_media_icons_widget ul {
margin: 0 0 -0.538461538em;
}
.widget.widget_wpcom_social_media_icons_widget li {
margin: 0 0.538461538em 0.538461538em 0;
}
.widget_top-posts .widgets-list-layout .widgets-list-layout-blavatar {
margin-top: 0.153846154em;
}
.widget_top-posts .widgets-list-layout-links {
width: -webkit-calc(100% - 4.153846154em);
width: calc(100% - 4.153846154em);
}
.widget_top-posts .widgets-list-layout li {
margin-bottom: 1.076923077em;
}
.widget_upcoming_events_widget .upcoming-events li {
margin-bottom: 1.076923077em
}
.entry-content #jp-relatedposts .jp-relatedposts-items .jp-relatedposts-post {
margin-bottom: 0;
padding-right: 0.875em;
width: 33%;
}
}
@media screen and (min-width: 61.5625em) {
body:not(.search-results) article:not(.type-page) .sharedaddy:last-child,
body:not(.search-results) article:not(.type-page) .jp-relatedposts:last-child {
padding-bottom: 0;
}
body:not(.search-results) article:not(.type-page) .sharedaddy:last-child:after,
body:not(.search-results) article:not(.type-page) .jp-relatedposts:last-child:after {
display: none;
}
body:not(.search-results) article:not(.type-page) img.below-entry-meta {
width: auto;
}
}

View file

@ -0,0 +1,49 @@
<?php
/**
* Jetpack Compatibility File
* See: http://jetpack.com/
*/
function twentysixteen_jetpack_setup() {
/**
* Add theme support for Responsive Videos.
*/
add_theme_support( 'jetpack-responsive-videos' );
}
add_action( 'after_setup_theme', 'twentysixteen_jetpack_setup' );
function twentysixteen_init_jetpack() {
/**
* Add our compat CSS file for custom widget stylings and such.
* Set the version equal to filemtime for development builds, and the JETPACK__VERSION for production
* or skip it entirely for wpcom.
*/
$version = false;
if ( method_exists( 'Jetpack', 'is_development_version' ) ) {
$version = Jetpack::is_development_version() ? filemtime( plugin_dir_path( __FILE__ ) . 'twentysixteen.css' ) : JETPACK__VERSION;
}
wp_enqueue_style( 'twentysixteen-jetpack', plugins_url( 'twentysixteen.css', __FILE__ ), array(), $version );
wp_style_add_data( 'twentysixteen-jetpack', 'rtl', 'replace' );
}
add_action( 'init', 'twentysixteen_init_jetpack' );
/**
* Alter gallery widget default width.
*/
function twentysixteen_gallery_widget_content_width( $width ) {
return 390;
}
add_filter( 'gallery_widget_content_width', 'twentysixteen_gallery_widget_content_width' );
/**
* Remove ratings from excerpts that are used as intro on blog index, single, and archive pages.
*/
function twentysixteen_remove_share() {
if ( is_single() || is_archive() || is_home() ) {
remove_filter( 'the_excerpt', 'sharing_display', 19 );
if ( class_exists( 'Jetpack_Likes' ) ) {
remove_filter( 'the_excerpt', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );
}
}
}
add_action( 'loop_start', 'twentysixteen_remove_share' );

View file

@ -0,0 +1,626 @@
<?php
if ( ! class_exists( 'Featured_Content' ) && isset( $GLOBALS['pagenow'] ) && 'plugins.php' !== $GLOBALS['pagenow'] ) {
/**
* Featured Content.
*
* This module will allow users to define a subset of posts to be displayed in a
* theme-designated featured content area.
*
* This feature will only be activated for themes that declare that they support
* it. This can be done by adding code similar to the following during the
* "after_setup_theme" action:
*
* add_theme_support( 'featured-content', array(
* 'filter' => 'mytheme_get_featured_content',
* 'max_posts' => 20,
* 'post_types' => array( 'post', 'page' ),
* ) );
*
* For maximum compatibility with different methods of posting users will
* designate a featured post tag to associate posts with. Since this tag now has
* special meaning beyond that of a normal tags, users will have the ability to
* hide it from the front-end of their site.
*/
class Featured_Content {
/**
* The maximum number of posts that a Featured Content area can contain. We
* define a default value here but themes can override this by defining a
* "max_posts" entry in the second parameter passed in the call to
* add_theme_support( 'featured-content' ).
*
* @see Featured_Content::init()
*/
public static $max_posts = 15;
/**
* The registered post types supported by Featured Content. Themes can add
* Featured Content support for registered post types by defining a
* 'post_types' argument (string|array) in the call to
* add_theme_support( 'featured-content' ).
*
* @see Featured_Content::init()
*/
public static $post_types = array( 'post' );
/**
* Instantiate.
*
* All custom functionality will be hooked into the "init" action.
*/
public static function setup() {
add_action( 'init', array( __CLASS__, 'init' ), 30 );
}
/**
* Conditionally hook into WordPress.
*
* Themes must declare that they support this module by adding
* add_theme_support( 'featured-content' ); during after_setup_theme.
*
* If no theme support is found there is no need to hook into WordPress. We'll
* just return early instead.
*
* @uses Featured_Content::$max_posts
*/
public static function init() {
$theme_support = get_theme_support( 'featured-content' );
// Return early if theme does not support featured content.
if ( ! $theme_support ) {
return;
}
/*
* An array of named arguments must be passed as the second parameter
* of add_theme_support().
*/
if ( ! isset( $theme_support[0] ) ) {
return;
}
if ( isset( $theme_support[0]['featured_content_filter'] ) ) {
$theme_support[0]['filter'] = $theme_support[0]['featured_content_filter'];
unset( $theme_support[0]['featured_content_filter'] );
}
// Return early if "filter" has not been defined.
if ( ! isset( $theme_support[0]['filter'] ) ) {
return;
}
// Theme can override the number of max posts.
if ( isset( $theme_support[0]['max_posts'] ) ) {
self::$max_posts = absint( $theme_support[0]['max_posts'] );
}
add_filter( $theme_support[0]['filter'], array( __CLASS__, 'get_featured_posts' ) );
add_action( 'customize_register', array( __CLASS__, 'customize_register' ), 9 );
add_action( 'admin_init', array( __CLASS__, 'register_setting' ) );
add_action( 'save_post', array( __CLASS__, 'delete_transient' ) );
add_action( 'delete_post_tag', array( __CLASS__, 'delete_post_tag' ) );
add_action( 'customize_controls_enqueue_scripts', array( __CLASS__, 'enqueue_scripts' ) );
add_action( 'pre_get_posts', array( __CLASS__, 'pre_get_posts' ) );
add_action( 'switch_theme', array( __CLASS__, 'switch_theme' ) );
add_action( 'switch_theme', array( __CLASS__, 'delete_transient' ) );
add_action( 'wp_loaded', array( __CLASS__, 'wp_loaded' ) );
add_action( 'split_shared_term', array( __CLASS__, 'jetpack_update_featured_content_for_split_terms', 10, 4 ) );
if ( isset( $theme_support[0]['additional_post_types'] ) ) {
$theme_support[0]['post_types'] = array_merge( array( 'post' ), (array) $theme_support[0]['additional_post_types'] );
unset( $theme_support[0]['additional_post_types'] );
}
// Themes can allow Featured Content pages
if ( isset( $theme_support[0]['post_types'] ) ) {
self::$post_types = array_merge( self::$post_types, (array) $theme_support[0]['post_types'] );
// register post_tag support for each post type
foreach ( self::$post_types as $post_type ) {
register_taxonomy_for_object_type( 'post_tag', $post_type );
}
}
}
/**
* Hide "featured" tag from the front-end.
*
* Has to run on wp_loaded so that the preview filters of the customizer
* have a chance to alter the value.
*/
public static function wp_loaded() {
if ( self::get_setting( 'hide-tag' ) ) {
add_filter( 'get_terms', array( __CLASS__, 'hide_featured_term' ), 10, 3 );
add_filter( 'get_the_terms', array( __CLASS__, 'hide_the_featured_term' ), 10, 3 );
}
}
/**
* Get featured posts
*
* This method is not intended to be called directly. Theme developers should
* place a filter directly in their theme and then pass its name as a value of
* the "filter" key in the array passed as the $args parameter during the call
* to: add_theme_support( 'featured-content', $args ).
*
* @uses Featured_Content::get_featured_post_ids()
*
* @return array
*/
public static function get_featured_posts() {
$post_ids = self::get_featured_post_ids();
// No need to query if there is are no featured posts.
if ( empty( $post_ids ) ) {
return array();
}
$featured_posts = get_posts( array(
'include' => $post_ids,
'posts_per_page' => count( $post_ids ),
'post_type' => self::$post_types,
) );
return $featured_posts;
}
/**
* Get featured post IDs
*
* This function will return the an array containing the post IDs of all
* featured posts.
*
* Sets the "featured_content_ids" transient.
*
* @return array Array of post IDs.
*/
public static function get_featured_post_ids() {
// Return array of cached results if they exist.
$featured_ids = get_transient( 'featured_content_ids' );
if ( ! empty( $featured_ids ) ) {
return array_map(
'absint',
/**
* Filter the list of Featured Posts IDs.
*
* @module theme-tools
*
* @since 2.7.0
*
* @param array $featured_ids Array of post IDs.
*/
apply_filters( 'featured_content_post_ids', (array) $featured_ids )
);
}
$settings = self::get_setting();
// Return empty array if no tag name is set.
$term = get_term_by( 'name', $settings['tag-name'], 'post_tag' );
if ( ! $term ) {
$term = get_term_by( 'id', $settings['tag-id'], 'post_tag' );
}
if ( $term ) {
$tag = $term->term_id;
} else {
/** This action is documented in modules/theme-tools/featured-content.php */
return apply_filters( 'featured_content_post_ids', array() );
}
// Back compat for installs that have the quantity option still set.
$quantity = isset( $settings['quantity'] ) ? $settings['quantity'] : self::$max_posts;
// Query for featured posts.
$featured = get_posts( array(
'numberposts' => $quantity,
'post_type' => self::$post_types,
'tax_query' => array(
array(
'field' => 'term_id',
'taxonomy' => 'post_tag',
'terms' => $tag,
),
),
) );
// Return empty array if no featured content exists.
if ( ! $featured ) {
/** This action is documented in modules/theme-tools/featured-content.php */
return apply_filters( 'featured_content_post_ids', array() );
}
// Ensure correct format before save/return.
$featured_ids = wp_list_pluck( (array) $featured, 'ID' );
$featured_ids = array_map( 'absint', $featured_ids );
set_transient( 'featured_content_ids', $featured_ids );
/** This action is documented in modules/theme-tools/featured-content.php */
return apply_filters( 'featured_content_post_ids', $featured_ids );
}
/**
* Delete Transient.
*
* Hooks in the "save_post" action.
* @see Featured_Content::validate_settings().
*/
public static function delete_transient() {
delete_transient( 'featured_content_ids' );
}
/**
* Exclude featured posts from the blog query when the blog is the front-page,
* and user has not checked the "Display tag content in all listings" checkbox.
*
* Filter the home page posts, and remove any featured post ID's from it.
* Hooked onto the 'pre_get_posts' action, this changes the parameters of the
* query before it gets any posts.
*
* @uses Featured_Content::get_featured_post_ids();
* @uses Featured_Content::get_setting();
* @param WP_Query $query
* @return WP_Query Possibly modified WP_Query
*/
public static function pre_get_posts( $query ) {
// Bail if not home or not main query.
if ( ! $query->is_home() || ! $query->is_main_query() ) {
return;
}
// Bail if the blog page is not the front page.
if ( 'posts' !== get_option( 'show_on_front' ) ) {
return;
}
$featured = self::get_featured_post_ids();
// Bail if no featured posts.
if ( ! $featured ) {
return;
}
$settings = self::get_setting();
// Bail if the user wants featured posts always displayed.
if ( true == $settings['show-all'] ) {
return;
}
// We need to respect post ids already in the blacklist.
$post__not_in = $query->get( 'post__not_in' );
if ( ! empty( $post__not_in ) ) {
$featured = array_merge( (array) $post__not_in, $featured );
$featured = array_unique( $featured );
}
$query->set( 'post__not_in', $featured );
}
/**
* Reset tag option when the saved tag is deleted.
*
* It's important to mention that the transient needs to be deleted, too.
* While it may not be obvious by looking at the function alone, the transient
* is deleted by Featured_Content::validate_settings().
*
* Hooks in the "delete_post_tag" action.
* @see Featured_Content::validate_settings().
*
* @param int $tag_id The term_id of the tag that has been deleted.
* @return void
*/
public static function delete_post_tag( $tag_id ) {
$settings = self::get_setting();
if ( empty( $settings['tag-id'] ) || $tag_id != $settings['tag-id'] ) {
return;
}
$settings['tag-id'] = 0;
$settings = self::validate_settings( $settings );
update_option( 'featured-content', $settings );
}
/**
* Hide featured tag from displaying when global terms are queried from
* the front-end.
*
* Hooks into the "get_terms" filter.
*
* @uses Featured_Content::get_setting()
*
* @param array $terms A list of term objects. This is the return value of get_terms().
* @param array $taxonomies An array of taxonomy slugs.
* @return array $terms
*/
public static function hide_featured_term( $terms, $taxonomies, $args ) {
// This filter is only appropriate on the front-end.
if ( is_admin() ) {
return $terms;
}
// We only want to hide the featured tag.
if ( ! in_array( 'post_tag', $taxonomies ) ) {
return $terms;
}
// Bail if no terms were returned.
if ( empty( $terms ) ) {
return $terms;
}
// Bail if term objects are unavailable.
if ( 'all' != $args['fields'] ) {
return $terms;
}
$settings = self::get_setting();
$tag = get_term_by( 'name', $settings['tag-name'], 'post_tag' );
if ( false !== $tag ) {
foreach ( $terms as $order => $term ) {
if ( is_object( $term ) && ( $settings['tag-id'] === $term->term_id || $settings['tag-name'] === $term->name ) ) {
unset( $terms[ $order ] );
}
}
}
return $terms;
}
/**
* Hide featured tag from displaying when terms associated with a post object
* are queried from the front-end.
*
* Hooks into the "get_the_terms" filter.
*
* @uses Featured_Content::get_setting()
*
* @param array $terms A list of term objects. This is the return value of get_the_terms().
* @param int $id The ID field for the post object that terms are associated with.
* @param array $taxonomy An array of taxonomy slugs.
* @return array $terms
*/
public static function hide_the_featured_term( $terms, $id, $taxonomy ) {
// This filter is only appropriate on the front-end.
if ( is_admin() ) {
return $terms;
}
// Make sure we are in the correct taxonomy.
if ( 'post_tag' != $taxonomy ) {
return $terms;
}
// No terms? Return early!
if ( empty( $terms ) ) {
return $terms;
}
$settings = self::get_setting();
$tag = get_term_by( 'name', $settings['tag-name'], 'post_tag' );
if ( false !== $tag ) {
foreach ( $terms as $order => $term ) {
if ( $settings['tag-id'] === $term->term_id || $settings['tag-name'] === $term->name ) {
unset( $terms[ $order ] );
}
}
}
return $terms;
}
/**
* Register custom setting on the Settings -> Reading screen.
*
* @uses Featured_Content::render_form()
* @uses Featured_Content::validate_settings()
*
* @return void
*/
public static function register_setting() {
add_settings_field( 'featured-content', __( 'Featured Content', 'jetpack' ), array( __class__, 'render_form' ), 'reading' );
// Register sanitization callback for the Customizer.
register_setting( 'featured-content', 'featured-content', array( __class__, 'validate_settings' ) );
}
/**
* Add settings to the Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
public static function customize_register( $wp_customize ) {
$wp_customize->add_section( 'featured_content', array(
'title' => __( 'Featured Content', 'jetpack' ),
'description' => sprintf( __( 'Easily feature all posts with the <a href="%1$s">"featured" tag</a> or a tag of your choice. Your theme supports up to %2$s posts in its featured content area.', 'jetpack' ), admin_url( '/edit.php?tag=featured' ), absint( self::$max_posts ) ),
'priority' => 130,
'theme_supports' => 'featured-content',
) );
/* Add Featured Content settings.
*
* Sanitization callback registered in Featured_Content::validate_settings().
* See http://themeshaper.com/2013/04/29/validation-sanitization-in-customizer/comment-page-1/#comment-12374
*/
$wp_customize->add_setting( 'featured-content[tag-name]', array(
'type' => 'option',
'sanitize_js_callback' => array( __CLASS__, 'delete_transient' ),
) );
$wp_customize->add_setting( 'featured-content[hide-tag]', array(
'default' => true,
'type' => 'option',
'sanitize_js_callback' => array( __CLASS__, 'delete_transient' ),
) );
$wp_customize->add_setting( 'featured-content[show-all]', array(
'default' => false,
'type' => 'option',
'sanitize_js_callback' => array( __CLASS__, 'delete_transient' ),
) );
// Add Featured Content controls.
$wp_customize->add_control( 'featured-content[tag-name]', array(
'label' => __( 'Tag name', 'jetpack' ),
'section' => 'featured_content',
'theme_supports' => 'featured-content',
'priority' => 20,
) );
$wp_customize->add_control( 'featured-content[hide-tag]', array(
'label' => __( 'Hide tag from displaying in post meta and tag clouds.', 'jetpack' ),
'section' => 'featured_content',
'theme_supports' => 'featured-content',
'type' => 'checkbox',
'priority' => 30,
) );
$wp_customize->add_control( 'featured-content[show-all]', array(
'label' => __( 'Display tag content in all listings.', 'jetpack' ),
'section' => 'featured_content',
'theme_supports' => 'featured-content',
'type' => 'checkbox',
'priority' => 40,
) );
}
/**
* Enqueue the tag suggestion script.
*/
public static function enqueue_scripts() {
wp_enqueue_script( 'featured-content-suggest', plugins_url( 'js/suggest.js', __FILE__ ), array( 'suggest' ), '20131022', true );
}
/**
* Renders all form fields on the Settings -> Reading screen.
*/
public static function render_form() {
printf( __( 'The settings for Featured Content have <a href="%s">moved to Appearance &rarr; Customize</a>.', 'jetpack' ), admin_url( 'customize.php?#accordion-section-featured_content' ) );
}
/**
* Get settings
*
* Get all settings recognized by this module. This function will return all
* settings whether or not they have been stored in the database yet. This
* ensures that all keys are available at all times.
*
* In the event that you only require one setting, you may pass its name as the
* first parameter to the function and only that value will be returned.
*
* @param string $key The key of a recognized setting.
* @return mixed Array of all settings by default. A single value if passed as first parameter.
*/
public static function get_setting( $key = 'all' ) {
$saved = (array) get_option( 'featured-content' );
/**
* Filter Featured Content's default settings.
*
* @module theme-tools
*
* @since 2.7.0
*
* @param array $args {
* Array of Featured Content Settings
*
* @type int hide-tag Default is 1.
* @type int tag-id Default is 0.
* @type string tag-name Default is empty.
* @type int show-all Default is 0.
* }
*/
$defaults = apply_filters( 'featured_content_default_settings', array(
'hide-tag' => 1,
'tag-id' => 0,
'tag-name' => '',
'show-all' => 0,
) );
$options = wp_parse_args( $saved, $defaults );
$options = array_intersect_key( $options, $defaults );
if ( 'all' != $key ) {
return isset( $options[ $key ] ) ? $options[ $key ] : false;
}
return $options;
}
/**
* Validate settings
*
* Make sure that all user supplied content is in an expected format before
* saving to the database. This function will also delete the transient set in
* Featured_Content::get_featured_content().
*
* @uses Featured_Content::delete_transient()
*
* @param array $input
* @return array $output
*/
public static function validate_settings( $input ) {
$output = array();
if ( empty( $input['tag-name'] ) ) {
$output['tag-id'] = 0;
} else {
$term = get_term_by( 'name', $input['tag-name'], 'post_tag' );
if ( $term ) {
$output['tag-id'] = $term->term_id;
} else {
$new_tag = wp_create_tag( $input['tag-name'] );
if ( ! is_wp_error( $new_tag ) && isset( $new_tag['term_id'] ) ) {
$output['tag-id'] = $new_tag['term_id'];
}
}
$output['tag-name'] = $input['tag-name'];
}
$output['hide-tag'] = isset( $input['hide-tag'] ) && $input['hide-tag'] ? 1 : 0;
$output['show-all'] = isset( $input['show-all'] ) && $input['show-all'] ? 1 : 0;
self::delete_transient();
return $output;
}
/**
* Removes the quantity setting from the options array.
*
* @return void
*/
public static function switch_theme() {
$option = (array) get_option( 'featured-content' );
if ( isset( $option['quantity'] ) ) {
unset( $option['quantity'] );
update_option( 'featured-content', $option );
}
}
public static function jetpack_update_featured_content_for_split_terms( $old_term_id, $new_term_id, $term_taxonomy_id, $taxonomy ) {
$featured_content_settings = get_option( 'featured-content', array() );
// Check to see whether the stored tag ID is the one that's just been split.
if ( isset( $featured_content_settings['tag-id'] ) && $old_term_id == $featured_content_settings['tag-id'] && 'post_tag' == $taxonomy ) {
// We have a match, so we swap out the old tag ID for the new one and resave the option.
$featured_content_settings['tag-id'] = $new_term_id;
update_option( 'featured-content', $featured_content_settings );
}
}
}
Featured_Content::setup();
} // end if ( ! class_exists( 'Featured_Content' ) && isset( $GLOBALS['pagenow'] ) && 'plugins.php' !== $GLOBALS['pagenow'] ) {

View file

@ -0,0 +1,48 @@
<?php
/**
* INFINITE SCROLL
*/
/**
* Load theme's infinite scroll annotation file, if present in the IS plugin.
* The `setup_theme` action is used because the annotation files should be using `after_setup_theme` to register support for IS.
*
* As released in Jetpack 2.0, a child theme's parent wasn't checked for in the plugin's bundled support, hence the convoluted way the parent is checked for now.
*
* @uses is_admin, wp_get_theme, get_theme, get_current_theme, apply_filters
* @action setup_theme
* @return null
*/
function jetpack_load_infinite_scroll_annotation() {
if ( is_admin() && isset( $_GET['page'] ) && 'jetpack' == $_GET['page'] ) {
$theme = function_exists( 'wp_get_theme' ) ? wp_get_theme() : get_theme( get_current_theme() );
if ( ! is_a( $theme, 'WP_Theme' ) && ! is_array( $theme ) )
return;
/** This filter is already documented in modules/infinite-scroll/infinity.php */
$customization_file = apply_filters( 'infinite_scroll_customization_file', dirname( __FILE__ ) . "/infinite-scroll/themes/{$theme['Stylesheet']}.php", $theme['Stylesheet'] );
if ( is_readable( $customization_file ) ) {
require_once( $customization_file );
} elseif ( ! empty( $theme['Template'] ) ) {
$customization_file = dirname( __FILE__ ) . "/infinite-scroll/themes/{$theme['Template']}.php";
if ( is_readable( $customization_file ) )
require_once( $customization_file );
}
}
}
add_action( 'setup_theme', 'jetpack_load_infinite_scroll_annotation' );
/**
* Prevent IS from being activated if theme doesn't support it
*
* @param bool $can_activate
* @filter jetpack_can_activate_infinite-scroll
* @return bool
*/
function jetpack_can_activate_infinite_scroll() {
return (bool) current_theme_supports( 'infinite-scroll' );
}
add_filter( 'jetpack_can_activate_infinite-scroll', 'jetpack_can_activate_infinite_scroll' );

View file

@ -0,0 +1,10 @@
/*
* WARNING: This file is distributed verbatim in Jetpack.
* There should be nothing WordPress.com specific in this file.
*
*/
/* global ajaxurl:true */
jQuery( function( $ ) {
$( '#customize-control-featured-content-tag-name input' ).suggest( ajaxurl + '?action=ajax-tag-search&tax=post_tag', { delay: 500, minchars: 2 } );
} );

View file

@ -0,0 +1,74 @@
<?php
/*
Plugin Name: Random Redirect
Plugin URI: http://wordpress.org/extend/plugins/random-redirect/
Description: Allows you to create a link to yourblog.example.com/?random which will redirect someone to a random post on your blog, in a StumbleUpon-like fashion.
Version: 1.2-wpcom
Author: Matt Mullenweg
Author URI: http://photomatt.net/
*/
function jetpack_matt_random_redirect() {
// Verify that the Random Redirect plugin this code is from is not active
// See http://plugins.trac.wordpress.org/ticket/1898
if ( ! ( defined( 'IS_WPCOM' ) && IS_WPCOM ) ) {
require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
if ( is_plugin_active( 'random-redirect/random-redirect.php' ) ) return;
}
// Set default post type.
$post_type = get_post_type();
// Set default category type
if ( is_category() ) {
$category = get_the_category();
if ( isset( $category ) && ! empty( $category ) ) {
$random_cat_id = $category[0]->term_id;
}
}
// Set author name if we're on an author archive.
if ( is_author() ) {
$random_author_name = get_the_author_meta( 'user_login' );
$random_author_query = 'AND user_login = "' . $random_author_name . '"';
}
// Acceptable URL formats: /[...]/?random=[post type], /?random, /&random, /&random=1
if ( ! isset( $_GET['random'] ) && ! in_array( strtolower( $_SERVER['REQUEST_URI'] ), array( '/&random', '/&random=1' ) ) )
return;
// Ignore POST requests.
if ( ! empty( $_POST ) )
return;
// Persistent AppEngine abuse. ORDER BY RAND is expensive.
if ( strstr( $_SERVER['HTTP_USER_AGENT'], 'AppEngine-Google' ) )
wp_die( 'Please <a href="http://en.support.wordpress.com/contact/" target="_blank">contact support</a>' );
// Set the category ID if the parameter is set.
if ( isset( $_GET['random_cat_id'] ) )
$random_cat_id = (int) $_GET['random_cat_id'];
// Change the post type if the parameter is set.
if ( isset( $_GET['random_post_type'] ) && post_type_exists( $_GET['random_post_type'] ) )
$post_type = $_GET['random_post_type'];
// Don't show a random page if 'page' isn't specified as the post type specifically.
if ( 'page' === $post_type && is_front_page() && ! isset( $_GET['random_post_type'] ) ) {
$post_type = 'post';
}
global $wpdb;
if ( isset( $random_cat_id ) ) {
$random_id = $wpdb->get_var( $wpdb->prepare( "SELECT DISTINCT ID FROM $wpdb->posts AS p INNER JOIN $wpdb->term_relationships AS tr ON (p.ID = tr.object_id AND tr.term_taxonomy_id = %s) INNER JOIN $wpdb->term_taxonomy AS tt ON(tr.term_taxonomy_id = tt.term_taxonomy_id AND taxonomy = 'category') WHERE p.post_type = %s AND post_password = '' AND post_status = 'publish' %s ORDER BY RAND() LIMIT 1", $random_cat_id, $post_type, $random_author_query ) );
} else {
$random_id = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_password = '' AND post_status = 'publish' %s ORDER BY RAND() LIMIT 1", $post_type, $random_author_query ) );
}
$permalink = get_permalink( $random_id );
wp_safe_redirect( $permalink );
exit;
}
add_action( 'template_redirect', 'jetpack_matt_random_redirect' );

View file

@ -0,0 +1,104 @@
<?php
/**
* Load the Responsive videos plugin
*/
function jetpack_responsive_videos_init() {
/* If the doesn't theme support 'jetpack-responsive-videos', don't continue */
if ( ! current_theme_supports( 'jetpack-responsive-videos' ) ) {
return;
}
/* If the theme does support 'jetpack-responsive-videos', wrap the videos */
add_filter( 'wp_video_shortcode', 'jetpack_responsive_videos_embed_html' );
add_filter( 'video_embed_html', 'jetpack_responsive_videos_embed_html' );
/* Only wrap oEmbeds if video */
add_filter( 'embed_oembed_html', 'jetpack_responsive_videos_maybe_wrap_oembed', 10, 2 );
add_filter( 'embed_handler_html', 'jetpack_responsive_videos_maybe_wrap_oembed', 10, 2 );
/* Wrap videos in Buddypress */
add_filter( 'bp_embed_oembed_html', 'jetpack_responsive_videos_embed_html' );
}
add_action( 'after_setup_theme', 'jetpack_responsive_videos_init', 99 );
/**
* Adds a wrapper to videos and enqueue script
*
* @return string
*/
function jetpack_responsive_videos_embed_html( $html ) {
if ( empty( $html ) || ! is_string( $html ) ) {
return $html;
}
if ( defined( 'SCRIPT_DEBUG' ) && true == SCRIPT_DEBUG ) {
wp_enqueue_script( 'jetpack-responsive-videos-script', plugins_url( 'responsive-videos/responsive-videos.js', __FILE__ ), array( 'jquery' ), '1.2', true );
} else {
wp_enqueue_script( 'jetpack-responsive-videos-min-script', plugins_url( 'responsive-videos/responsive-videos.min.js', __FILE__ ), array( 'jquery' ), '1.2', true );
}
// Enqueue CSS to ensure compatibility with all themes
wp_enqueue_style( 'jetpack-responsive-videos-style', plugins_url( 'responsive-videos/responsive-videos.css', __FILE__ ) );
return '<div class="jetpack-video-wrapper">' . $html . '</div>';
}
/**
* Check if oEmbed is a `$video_patterns` provider video before wrapping.
*
* @return string
*/
function jetpack_responsive_videos_maybe_wrap_oembed( $html, $url = null ) {
if ( empty( $html ) || ! is_string( $html ) || ! $url ) {
return $html;
}
$jetpack_video_wrapper = '<div class="jetpack-video-wrapper">';
$already_wrapped = strpos( $html, $jetpack_video_wrapper );
// If the oEmbed has already been wrapped, return the html.
if ( false !== $already_wrapped ) {
return $html;
}
/**
* oEmbed Video Providers.
*
* A whitelist of oEmbed video provider Regex patterns to check against before wrapping the output.
*
* @module theme-tools
*
* @since 3.8.0
*
* @param array $video_patterns oEmbed video provider Regex patterns.
*/
$video_patterns = apply_filters( 'jetpack_responsive_videos_oembed_videos', array(
'https?://((m|www)\.)?youtube\.com/watch',
'https?://((m|www)\.)?youtube\.com/playlist',
'https?://youtu\.be/',
'https?://(.+\.)?vimeo\.com/',
'https?://(www\.)?dailymotion\.com/',
'https?://dai.ly/',
'https?://(www\.)?hulu\.com/watch/',
'https?://wordpress.tv/',
'https?://(www\.)?funnyordie\.com/videos/',
'https?://vine.co/v/',
'https?://(www\.)?collegehumor\.com/video/',
'https?://(www\.|embed\.)?ted\.com/talks/'
) );
// Merge patterns to run in a single preg_match call.
$video_patterns = '(' . implode( '|', $video_patterns ) . ')';
$is_video = preg_match( $video_patterns, $url );
// If the oEmbed is a video, wrap it in the responsive wrapper.
if ( false === $already_wrapped && 1 === $is_video ) {
return jetpack_responsive_videos_embed_html( $html );
}
return $html;
}

View file

@ -0,0 +1,10 @@
.jetpack-video-wrapper {
margin-bottom: 1.6em;
}
.jetpack-video-wrapper > embed,
.jetpack-video-wrapper > iframe,
.jetpack-video-wrapper > object,
.jetpack-video-wrapper > .wp-video {
margin-bottom: 0;
}

View file

@ -0,0 +1,98 @@
( function( $ ) {
/**
* A function to help debouncing.
*/
var debounce = function( func, wait ) {
var timeout, args, context, timestamp;
return function() {
context = this;
args = [].slice.call( arguments, 0 );
timestamp = new Date();
var later = function() {
var last = ( new Date() ) - timestamp;
if ( last < wait ) {
timeout = setTimeout( later, wait - last );
} else {
timeout = null;
func.apply( context, args );
}
};
if ( ! timeout ) {
timeout = setTimeout( later, wait );
}
};
};
/**
* A function to resize videos.
*/
function responsive_videos() {
$( '.jetpack-video-wrapper' ).find( 'embed, iframe, object' ).each( function() {
var video_element, video_width, video_height, video_ratio, video_wrapper, video_margin, container_width;
video_element = $( this );
video_margin = 0;
if ( video_element.parents( '.jetpack-video-wrapper' ).prev( 'p' ).css( 'text-align' ) === 'center' ) {
video_margin = '0 auto';
}
if ( ! video_element.attr( 'data-ratio' ) ) {
video_element
.attr( 'data-ratio', this.height / this.width )
.attr( 'data-width', this.width )
.attr( 'data-height', this.height )
.css( {
'display' : 'block',
'margin' : video_margin
} );
}
video_width = video_element.attr( 'data-width' );
video_height = video_element.attr( 'data-height' );
video_ratio = video_element.attr( 'data-ratio' );
video_wrapper = video_element.parent();
container_width = video_wrapper.width();
if ( video_ratio === 'Infinity' ) {
video_width = '100%';
}
video_element
.removeAttr( 'height' )
.removeAttr( 'width' );
if ( video_width > container_width ) {
video_element
.width( container_width )
.height( container_width * video_ratio );
} else {
video_element
.width( video_width )
.height( video_height );
}
} );
}
/**
* Load responsive_videos().
* Trigger resize to make sure responsive_videos() is loaded after IS.
*/
$( window ).load( responsive_videos ).resize( debounce( responsive_videos, 100 ) ).trigger( 'resize' );
$( document ).on( 'post-load', responsive_videos );
} )( jQuery );

View file

@ -0,0 +1 @@
!function(t){function a(){t(".jetpack-video-wrapper").find("embed, iframe, object").each(function(){var a,e,i,r,h,n,d;a=t(this),n=0,"center"===a.parents(".jetpack-video-wrapper").prev("p").css("text-align")&&(n="0 auto"),a.attr("data-ratio")||a.attr("data-ratio",this.height/this.width).attr("data-width",this.width).attr("data-height",this.height).css({display:"block",margin:n}),e=a.attr("data-width"),i=a.attr("data-height"),r=a.attr("data-ratio"),h=a.parent(),d=h.width(),"Infinity"===r&&(e="100%"),a.removeAttr("height").removeAttr("width"),e>d?a.width(d).height(d*r):a.width(e).height(i)})}var e=function(t,a){var e,i,r,h;return function(){r=this,i=[].slice.call(arguments,0),h=new Date;var n=function(){var d=new Date-h;a>d?e=setTimeout(n,a-d):(e=null,t.apply(r,i))};e||(e=setTimeout(n,a))}};t(window).load(a).resize(e(a,100)).trigger("resize"),t(document).on("post-load",a)}(jQuery);

View file

@ -0,0 +1,37 @@
<?php
/**
* Plugin Name: Site Breadcrumbs
* Plugin URI: http://wordpress.com
* Description: Quickly add breadcrumbs to the single view of a hierarchical post type
* Author: Automattic
* Version: 1.0
* Author URI: http://wordpress.com
* License: GPL2 or later
*/
function jetpack_breadcrumbs() {
if ( ! is_page() || is_front_page() ) {
return;
}
global $post;
$ancestors = array_reverse( get_post_ancestors( $post->ID ) );
$before = '<nav class="entry-breadcrumbs" itemscope itemtype="http://schema.org/BreadcrumbList">';
$after = '</nav>';
$home = '<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="' . esc_url( home_url( "/" ) ) . '" class="home-link" itemprop="item" rel="home"><span itemprop="name">' . __( 'Home', 'jetpack' ) . '</span></a></span>';
$breadcrumb = '';
if ( $ancestors ) {
foreach ( $ancestors as $ancestor ) {
$breadcrumb .= '<span itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="' . esc_url( get_permalink( $ancestor ) ) . '" itemprop="item"><span itemprop="name">' . esc_html( get_the_title( $ancestor ) ) . '</span></a></span>';
}
}
$breadcrumb .= '<span class="current-page" itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><span itemprop="name">' . esc_html( get_the_title( $post->ID ) ) . '</span></span>';
echo $before . $home . $breadcrumb . $after;
}

View file

@ -0,0 +1,46 @@
<?php
/*
* Site Logo.
* @see http://jetpack.com/support/site-logo/
*
* This feature will only be activated for themes that declare their support.
* This can be done by adding code similar to the following during the
* 'after_setup_theme' action:
*
* $args = array(
* 'header-text' => array(
* 'site-title',
* 'site-description',
* ),
* 'size' => 'medium',
* );
* add_theme_support( 'site-logo', $args );
*
*/
/**
* Activate the Site Logo plugin.
*
* @uses current_theme_supports()
* @since 3.2
*/
function site_logo_init() {
// For transferring existing site logo from Jetpack -> Core
if ( current_theme_supports( 'custom-logo' ) && ! get_theme_mod( 'custom_logo' ) && $jp_logo = get_option( 'site_logo' ) ) {
set_theme_mod( 'custom_logo', $jp_logo['id'] );
delete_option( 'site_logo' );
}
// Only load our code if our theme declares support, and the standalone plugin is not activated.
if ( current_theme_supports( 'site-logo' ) && ! class_exists( 'Site_Logo', false ) ) {
// Load our class for namespacing.
require( dirname( __FILE__ ) . '/site-logo/inc/class-site-logo.php' );
// Load template tags.
require( dirname( __FILE__ ) . '/site-logo/inc/functions.php' );
// Load backwards-compatible template tags.
require( dirname( __FILE__ ) . '/site-logo/inc/compat.php' );
}
}
add_action( 'init', 'site_logo_init' );

View file

@ -0,0 +1,12 @@
/**
* RTL styles for the Site Logo control. Just swaps the button sides.
*/
#customize-control-site_logo .remove {
float: right;
margin-left: 3px;
}
#customize-control-site_logo .new,
#customize-control-site_logo .change {
float: left;
}

View file

@ -0,0 +1 @@
#customize-control-site_logo .remove{float:right;margin-left:3px}#customize-control-site_logo .change,#customize-control-site_logo .new{float:left}

View file

@ -0,0 +1,49 @@
/**
* Styles for the Site Logo control.
*/
#customize-control-site_logo .current {
margin-bottom: 6px;
}
#customize-control-site_logo .current span {
border: 1px solid #eee;
-webkit-border-radius: 2px;
border-radius: 2px;
color: #555;
display: block;
overflow: hidden;
line-height: 40px;
min-height: 40px;
padding: 0 6px;
text-align: center;
text-overflow: ellipsis;
white-space: nowrap;
}
#customize-control-site_logo .current img {
max-width: 100%;
}
#customize-control-site_logo button.new,
#customize-control-site_logo button.change,
#customize-control-site_logo button.remove {
height: auto;
width: 48%;
white-space: normal;
}
#customize-control-site_logo .remove {
float: left;
margin-right: 3px;
}
#customize-control-site_logo .new,
#customize-control-site_logo .change {
float: right;
}
#customize-control-site_logo .customize-control-description {
display: block;
clear: both;
margin-bottom: 10px;
}

View file

@ -0,0 +1 @@
#customize-control-site_logo .current{margin-bottom:6px}#customize-control-site_logo .current span{border:1px solid #eee;-webkit-border-radius:2px;border-radius:2px;color:#555;display:block;overflow:hidden;line-height:40px;min-height:40px;padding:0 6px;text-align:center;text-overflow:ellipsis;white-space:nowrap}#customize-control-site_logo .current img{max-width:100%}#customize-control-site_logo button.change,#customize-control-site_logo button.new,#customize-control-site_logo button.remove{height:auto;width:48%;white-space:normal}#customize-control-site_logo .remove{float:left;margin-right:3px}#customize-control-site_logo .change,#customize-control-site_logo .new{float:right}#customize-control-site_logo .customize-control-description{display:block;clear:both;margin-bottom:10px}

View file

@ -0,0 +1,108 @@
<?php
/**
* Custom logo uploader control for the Customizer.
*
* @package Jetpack
*/
class Site_Logo_Image_Control extends WP_Customize_Control {
/**
* Constructor for our custom control.
*
* @param object $wp_customize
* @param string $control_id
* @param array $args
* @uses Site_Logo_Image_Control::l10n()
*/
public function __construct( $wp_customize, $control_id, $args = array() ) {
// declare these first so they can be overridden
$this->l10n = array(
'upload' => __( 'Add logo', 'jetpack' ),
'set' => __( 'Set as logo', 'jetpack' ),
'choose' => __( 'Choose logo', 'jetpack' ),
'change' => __( 'Change logo', 'jetpack' ),
'remove' => __( 'Remove logo', 'jetpack' ),
'placeholder' => __( 'No logo set', 'jetpack' ),
);
parent::__construct( $wp_customize, $control_id, $args );
}
/**
* This will be critical for our JS constructor.
*/
public $type = 'site_logo';
/**
* Allows overriding of global labels by a specific control.
*/
public $l10n = array();
/**
* The type of files that should be allowed by the media modal.
*/
public $mime_type = 'image';
/**
* Enqueue our media manager resources, scripts, and styles.
*
* @uses wp_enqueue_media()
* @uses wp_enqueue_style()
* @uses wp_enqueue_script()
* @uses plugins_url()
*/
public function enqueue() {
// Enqueues all needed media resources.
wp_enqueue_media();
// Enqueue our control script and styles.
wp_enqueue_style( 'site-logo-control', plugins_url( '../css/site-logo-control.css', __FILE__ ) );
wp_enqueue_script( 'site-logo-control', plugins_url( '../js/site-logo-control.js', __FILE__ ), array( 'media-views', 'customize-controls', 'underscore' ), '', true );
}
/**
* Check if we have an active site logo.
*
* @uses get_option()
* @return boolean
*/
public function has_site_logo() {
$logo = get_option( 'site_logo' );
if ( empty( $logo['url'] ) ) {
return false;
} else {
return true;
}
}
/**
* Display our custom control in the Customizer.
*
* @uses Site_Logo_Image_Control::l10n()
* @uses Site_Logo_Image_Control::mime_type()
* @uses Site_Logo_Image_Control::label()
* @uses Site_Logo_Image_Control::description()
* @uses esc_attr()
* @uses esc_html()
*/
public function render_content() {
// We do this to allow the upload control to specify certain labels
$l10n = json_encode( $this->l10n );
// Control title
printf(
'<span class="customize-control-title" data-l10n="%s" data-mime="%s">%s</span>',
esc_attr( $l10n ),
esc_attr( $this->mime_type ),
esc_html( $this->label )
);
// Control description
if ( ! empty( $this->description ) ) : ?>
<span class="description customize-control-description"><?php echo $this->description; ?></span>
<?php endif; ?>
<div class="current"></div>
<div class="actions"></div>
<?php }
}

View file

@ -0,0 +1,359 @@
<?php
/**
* Our Site Logo class for managing a theme-agnostic logo through the Customizer.
*
* @package Jetpack
*/
class Site_Logo {
/**
* Stores our single instance.
*/
private static $instance;
/**
* Stores our current logo settings.
*/
public $logo;
/**
* Return our instance, creating a new one if necessary.
*
* @uses Site_Logo::$instance
* @return object Site_Logo
*/
public static function instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new Site_Logo;
self::$instance->register_hooks();
}
return self::$instance;
}
/**
* Get our current logo settings stored in options.
*
* @uses get_option()
*/
private function __construct() {
$this->logo = get_option( 'site_logo', null );
}
/**
* Register our actions and filters.
*
* @uses Site_Logo::head_text_styles()
* @uses Site_Logo::customize_register()
* @uses Site_Logo::preview_enqueue()
* @uses Site_Logo::body_classes()
* @uses Site_Logo::media_manager_image_sizes()
* @uses add_action
* @uses add_filter
*/
public function register_hooks() {
// This would only happen if a theme supports BOTH site-logo and custom-logo for some reason
if ( current_theme_supports( 'custom-logo' ) ) {
return;
}
add_action( 'wp_head', array( $this, 'head_text_styles' ) );
add_action( 'customize_register', array( $this, 'customize_register' ) );
add_action( 'customize_preview_init', array( $this, 'preview_enqueue' ) );
add_action( 'delete_attachment', array( $this, 'reset_on_attachment_delete' ) );
add_filter( 'body_class', array( $this, 'body_classes' ) );
add_filter( 'image_size_names_choose', array( $this, 'media_manager_image_sizes' ) );
add_filter( 'display_media_states', array( $this, 'add_media_state' ) );
}
/**
* Add our logo uploader to the Customizer.
*
* @param object $wp_customize Customizer object.
* @uses current_theme_supports()
* @uses current_theme_supports()
* @uses WP_Customize_Manager::add_setting()
* @uses WP_Customize_Manager::add_control()
* @uses Site_Logo::sanitize_checkbox()
*/
public function customize_register( $wp_customize ) {
// Include our custom control.
require( dirname( __FILE__ ) . '/class-site-logo-control.php' );
//Update the Customizer section title for discoverability.
$wp_customize->get_section('title_tagline')->title = __( 'Site Title, Tagline, and Logo', 'jetpack' );
// Add a setting to hide header text if the theme isn't supporting the feature itself
if ( ! current_theme_supports( 'custom-header' ) ) {
$wp_customize->add_setting( 'site_logo_header_text', array(
'default' => 1,
'sanitize_callback' => array( $this, 'sanitize_checkbox' ),
'transport' => 'postMessage',
) );
$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'site_logo_header_text', array(
'label' => __( 'Display Header Text', 'jetpack' ),
'section' => 'title_tagline',
'settings' => 'site_logo_header_text',
'type' => 'checkbox',
) ) );
}
// Add the setting for our logo value.
$wp_customize->add_setting( 'site_logo', array(
'capability' => 'manage_options',
'default' => array(
'id' => 0,
'sizes' => array(),
'url' => false,
),
'sanitize_callback' => array( $this, 'sanitize_logo_setting' ),
'transport' => 'postMessage',
'type' => 'option',
) );
// Add our image uploader.
$wp_customize->add_control( new Site_Logo_Image_Control( $wp_customize, 'site_logo', array(
'label' => __( 'Logo', 'jetpack' ),
'section' => 'title_tagline',
'settings' => 'site_logo',
) ) );
}
/**
* Enqueue scripts for the Customizer live preview.
*
* @uses wp_enqueue_script()
* @uses plugins_url()
* @uses current_theme_supports()
* @uses Site_Logo::header_text_classes()
* @uses wp_localize_script()
*/
public function preview_enqueue() {
wp_enqueue_script( 'site-logo-preview', plugins_url( '../js/site-logo.js', __FILE__ ), array( 'media-views' ), '', true );
// Don't bother passing in header text classes if the theme supports custom headers.
if ( ! current_theme_supports( 'custom-header' ) ) {
$classes = jetpack_sanitize_header_text_classes( $this->header_text_classes() );
wp_enqueue_script( 'site-logo-header-text', plugins_url( '../js/site-logo-header-text.js', __FILE__ ), array( 'media-views' ), '', true );
wp_localize_script( 'site-logo-header-text', 'site_logo_header_classes', $classes );
}
}
/**
* Get header text classes. If not defined in add_theme_support(), defaults from Underscores will be used.
*
* @uses get_theme_support
* @return string String of classes to hide
*/
public function header_text_classes() {
$args = get_theme_support( 'site-logo' );
if ( isset( $args[0][ 'header-text' ] ) ) {
// Use any classes defined in add_theme_support().
$classes = $args[0][ 'header-text' ];
} else {
// Otherwise, use these defaults, which will work with any Underscores-based theme.
$classes = array(
'site-title',
'site-description',
);
}
// If we've got an array, reduce them to a string for output
if ( is_array( $classes ) ) {
$classes = (string) '.' . implode( ', .', $classes );
} else {
$classes = (string) '.' . $classes;
}
return $classes;
}
/**
* Hide header text on front-end if necessary.
*
* @uses current_theme_supports()
* @uses get_theme_mod()
* @uses Site_Logo::header_text_classes()
* @uses esc_html()
*/
public function head_text_styles() {
// Bail if our theme supports custom headers.
if ( current_theme_supports( 'custom-header' ) ) {
return;
}
// Is Display Header Text unchecked? If so, we need to hide our header text.
if ( ! get_theme_mod( 'site_logo_header_text', 1 ) ) {
$classes = $this->header_text_classes();
?>
<!-- Site Logo: hide header text -->
<style type="text/css">
<?php echo jetpack_sanitize_header_text_classes( $classes ); ?> {
position: absolute;
clip: rect(1px, 1px, 1px, 1px);
}
</style>
<?php
}
}
/**
* Determine image size to use for the logo.
*
* @uses get_theme_support()
* @return string Size specified in add_theme_support declaration, or 'thumbnail' default
*/
public function theme_size() {
$args = get_theme_support( 'site-logo' );
$valid_sizes = get_intermediate_image_sizes();
// Add 'full' to the list of accepted values.
$valid_sizes[] = 'full';
// If the size declared in add_theme_support is valid, use it; otherwise, just go with 'thumbnail'.
$size = ( isset( $args[0]['size'] ) && in_array( $args[0]['size'], $valid_sizes ) ) ? $args[0]['size'] : 'thumbnail';
return $size;
}
/**
* Make custom image sizes available to the media manager.
*
* @param array $sizes
* @uses get_intermediate_image_sizes()
* @return array All default and registered custom image sizes.
*/
public function media_manager_image_sizes( $sizes ) {
// Get an array of all registered image sizes.
$intermediate = get_intermediate_image_sizes();
// Have we got anything fun to work with?
if ( is_array( $intermediate ) && ! empty( $intermediate ) ) {
foreach ( $intermediate as $key => $size ) {
// If the size isn't already in the $sizes array, add it.
if ( ! array_key_exists( $size, $sizes ) ) {
$sizes[ $size ] = $size;
}
}
}
return $sizes;
}
/**
* Add site logos to media states in the Media Manager.
*
* @return array The current attachment's media states.
*/
public function add_media_state( $media_states ) {
// Only bother testing if we have a site logo set.
if ( $this->has_site_logo() ) {
global $post;
// If our attachment ID and the site logo ID match, this image is the site logo.
if ( $post->ID == $this->logo['id'] ) {
$media_states[] = __( 'Site Logo', 'jetpack' );
}
}
return $media_states;
}
/**
* Reset the site logo if the current logo is deleted in the media manager.
*
* @param int $site_id
* @uses Site_Logo::remove_site_logo()
*/
public function reset_on_attachment_delete( $post_id ) {
if ( $this->logo['id'] == $post_id ) {
$this->remove_site_logo();
}
}
/**
* Determine if a site logo is assigned or not.
*
* @uses Site_Logo::$logo
* @return boolean True if there is an active logo, false otherwise
*/
public function has_site_logo() {
return ( isset( $this->logo['id'] ) && 0 !== $this->logo['id'] ) ? true : false;
}
/**
* Reset the site logo option to zero (empty).
*
* @uses update_option()
*/
public function remove_site_logo() {
update_option( 'site_logo', array(
'id' => (int) 0,
'sizes' => array(),
'url' => '',
) );
}
/**
* Adds custom classes to the array of body classes.
*
* @uses Site_Logo::has_site_logo()
* @return array Array of <body> classes
*/
public function body_classes( $classes ) {
// Add a class if a Site Logo is active
if ( $this->has_site_logo() ) {
$classes[] = 'has-site-logo';
}
return $classes;
}
/**
* Sanitize our header text Customizer setting.
*
* @param $input
* @return mixed 1 if checked, empty string if not checked.
*/
public function sanitize_checkbox( $input ) {
return ( 1 == $input ) ? 1 : '';
}
/**
* Validate and sanitize a new site logo setting.
*
* @param $input
* @return mixed 1 if checked, empty string if not checked.
*/
public function sanitize_logo_setting( $input ) {
$input['id'] = absint( $input['id'] );
$input['url'] = esc_url_raw( $input['url'] );
// If the new setting doesn't point to a valid attachment, just reset the whole thing.
if ( false == wp_get_attachment_image_src( $input['id'] ) ) {
$input = array(
'id' => (int) 0,
'sizes' => array(),
'url' => '',
);
}
return $input;
}
}
/**
* Allow themes and plugins to access Site_Logo methods and properties.
*
* @uses Site_Logo::instance()
* @return object Site_Logo
*/
function site_logo() {
return Site_Logo::instance();
}
/**
* One site logo, please.
*/
site_logo();

View file

@ -0,0 +1,44 @@
<?php
/**
* Functions for maintaining backwards compatibility with unprefixed template tags from the original Site Logo plugin.
* These should never be used in themes; instead, use the template tags in functions.php.
* See: https://github.com/Automattic/jetpack/pull/956
*
* @package Jetpack
*/
if ( ! function_exists( 'the_site_logo' ) ) :
/**
* Unprefixed, backwards-compatible function for outputting the site logo.
*
* @uses jetpack_the_site_logo()
*/
function the_site_logo() {
jetpack_the_site_logo();
}
endif;
if ( ! function_exists( 'has_site_logo' ) ) :
/**
* Unprefixed, backwards-compatible function for determining if a site logo has been set.
*
* @uses jetpack_has_site_logo()
* @return bool True if a site logo is set, false otherwise.
*/
function has_site_logo() {
return jetpack_has_site_logo();
}
endif;
if ( ! function_exists( 'get_site_logo' ) ) :
/**
* Unprefixed, backwards-compatible function for getting either the site logo's image URL or its ID.
*
* @param string $show Return the site logo URL or ID.
* @uses jetpack_get_site_logo()
* @return string Site logo ID or URL (the default).
*/
function get_site_logo( $show = 'url' ) {
return jetpack_get_site_logo( $show );
}
endif;

View file

@ -0,0 +1,174 @@
<?php
/**
* Functions and template tags for using site logos.
*
* @package Jetpack
*/
/**
* Retrieve the site logo URL or ID (URL by default). Pass in the string 'id' for ID.
*
* @uses get_option()
* @uses esc_url_raw()
* @uses set_url_scheme()
* @return mixed The URL or ID of our site logo, false if not set
* @since 1.0
*/
function jetpack_get_site_logo( $show = 'url' ) {
$logo = site_logo()->logo;
// Return false if no logo is set
if ( ! isset( $logo['id'] ) || 0 == $logo['id'] ) {
return false;
}
// Return the ID if specified, otherwise return the URL by default
if ( 'id' == $show ) {
return $logo['id'];
} else {
return esc_url_raw( set_url_scheme( $logo['url'] ) );
}
}
/**
* Retrieve an array of the dimensions of the Site Logo.
*
* @uses Site_Logo::theme_size()
* @uses get_option( 'thumbnail_size_w' )
* @uses get_option( 'thumbnail_size_h' )
* @uses global $_wp_additional_image_sizes;
*
* @since 3.6.0
*
* @return array $dimensions {
* An array of dimensions of the Site Logo.
*
* @type string $width Width of the logo in pixels.
* @type string $height Height of the logo in pixels.
* }
*/
function jetpack_get_site_logo_dimensions() {
// Get the image size to use with the logo.
$size = site_logo()->theme_size();
// If the size is the default `thumbnail`, get its dimensions. Otherwise, get them from $_wp_additional_image_sizes
if ( empty( $size ) ) {
return false;
} else if ( 'thumbnail' == $size ) {
$dimensions = array(
'width' => get_option( 'thumbnail_size_w' ),
'height' => get_option( 'thumbnail_size_h' ),
);
} else {
global $_wp_additional_image_sizes;
if ( ! isset( $_wp_additional_image_sizes[ $size ] ) ) {
return false;
}
$dimensions = array(
'width' => $_wp_additional_image_sizes[ $size ][ 'width' ],
'height' => $_wp_additional_image_sizes[ $size ][ 'height' ],
);
}
return $dimensions;
}
/**
* Determine if a site logo is assigned or not.
*
* @uses get_option
* @return boolean True if there is an active logo, false otherwise
*/
function jetpack_has_site_logo() {
return site_logo()->has_site_logo();
}
/**
* Output an <img> tag of the site logo, at the size specified
* in the theme's add_theme_support() declaration.
*
* @uses Site_Logo::logo
* @uses Site_Logo::theme_size()
* @uses jetpack_has_site_logo()
* @uses jetpack_is_customize_preview()
* @uses esc_url()
* @uses home_url()
* @uses esc_attr()
* @uses wp_get_attachment_image()
* @uses apply_filters()
* @since 1.0
*/
function jetpack_the_site_logo() {
$logo = site_logo()->logo;
$logo_id = get_theme_mod( 'custom_logo' ); // Check for WP 4.5 Site Logo
$logo_id = $logo_id ? $logo_id : $logo['id']; // Use WP Core logo if present, otherwise use Jetpack's.
$size = site_logo()->theme_size();
$html = '';
// If no logo is set, but we're in the Customizer, leave a placeholder (needed for the live preview).
if ( ! jetpack_has_site_logo() ) {
if ( jetpack_is_customize_preview() ) {
$html = sprintf( '<a href="%1$s" class="site-logo-link" style="display:none;"><img class="site-logo" data-size="%2$s" /></a>',
esc_url( home_url( '/' ) ),
esc_attr( $size )
);
}
}
// We have a logo. Logo is go.
else {
$html = sprintf( '<a href="%1$s" class="site-logo-link" rel="home" itemprop="url">%2$s</a>',
esc_url( home_url( '/' ) ),
wp_get_attachment_image(
$logo_id,
$size,
false,
array(
'class' => "site-logo attachment-$size",
'data-size' => $size,
'itemprop' => "logo"
)
)
);
}
/**
* Filter the Site Logo output.
*
* @module theme-tools
*
* @since 3.2.0
*
* @param string $html Site Logo HTML output.
* @param array $logo Array of Site Logo details.
* @param string $size Size specified in add_theme_support declaration, or 'thumbnail' default.
*/
echo apply_filters( 'jetpack_the_site_logo', $html, $logo, $size );
}
/**
* Whether the site is being previewed in the Customizer.
* Duplicate of core function until 4.0 is released.
*
* @global WP_Customize_Manager $wp_customize Customizer instance.
* @return bool True if the site is being previewed in the Customizer, false otherwise.
*/
function jetpack_is_customize_preview() {
global $wp_customize;
return is_a( $wp_customize, 'WP_Customize_Manager' ) && $wp_customize->is_preview();
}
/**
* Sanitize the string of classes used for header text.
* Limit to A-Z,a-z,0-9,(space),(comma),_,-
*
* @return string Sanitized string of CSS classes.
*/
function jetpack_sanitize_header_text_classes( $classes ) {
$classes = preg_replace( '/[^A-Za-z0-9\,\ ._-]/', '', $classes );
return $classes;
}

View file

@ -0,0 +1,155 @@
/**
* JS for handling the Site Logo Customizer control.
*/
(function( wp, $ ){
// nice shortcut
var api = wp.customize;
/**
* The Customizer looks for wp.customizer.controlConstructor[type] functions
* where type == the type member of a WP_Customize_Control
*/
api.controlConstructor.site_logo = api.Control.extend({
/**
* This method is called when the control is ready to run.
* Do all of your setup and event binding here.
*/
ready: function() {
// this.container is a jQuery object of your container
// grab the bits of data from the title for specifying this control
var data = this.container.find( '.customize-control-title' ).data();
// Use specific l10n data for this control where available
this.l10n = data.l10n;
// Grab mime type
this.mime = data.mime;
// Set up image container and button elements. Cache for re-use.
this.$imgContainer = $( '#customize-control-site_logo .current' );
this.$btnContainer = $( '#customize-control-site_logo .actions' );
this.$img = $( '<img class="site-logo-thumbnail" />' ).prependTo( this.$imgContainer );
this.$placeholder = $( '<span>' + this.l10n.placeholder + '</span>' ).prependTo( this.$imgContainer );
this.$btnAdd = $( '<button type="button" class="button new">' + this.l10n.upload + '</button>' ).prependTo( this.$btnContainer );
this.$btnChange = $( '<button type="button" class="button change">' + this.l10n.change + '</button>' ).prependTo( this.$btnContainer );
this.$btnRemove = $( '<button type="button" class="button remove">' + this.l10n.remove + '</button>' ).prependTo( this.$btnContainer );
// handy shortcut so we don't have to us _.bind every time we add a callback
_.bindAll( this, 'removeImg', 'upload', 'render', 'pick' );
this.$btnAdd.on( 'click', this.upload );
this.$btnChange.on( 'click', this.upload );
this.$btnRemove.on( 'click', this.removeImg );
// Call render method whenever setting is changed.
this.setting.bind( 'change', this.render );
// Do initial rendering.
this.render();
},
/**
* Remember that _.bind was used to maintain `this` as the control
* object rather than the usual jQuery way of binding to the DOM element.
*/
upload: function( event ) {
event.preventDefault();
if ( ! this.frame ) {
this.initFrame();
}
this.frame.open();
},
/**
* Set the media frame so that it can be reused and accessed when needed.
*/
initFrame: function() {
this.frame = wp.media({
// The title of the media modal
title: this.l10n.choose,
// restrict to specified mime type
library: {
type: this.mime
},
// Customize the submit button.
button: {
// Set the text of the button.
text: this.l10n.set
},
// Just one, thanks.
multiple: false
});
// When an image is selected, run a callback.
this.frame.on( 'select', this.pick );
},
/**
* Fired when an image is selected in the media modal. Gets the selected
* image information, and sets it within the control.
*/
pick: function() {
// get the attachment from the modal frame
var attachment = this.frame.state().get( 'selection' ).single();
if ( 'image' === attachment.get( 'type' ) ) {
// set the setting - the callback will take care of rendering
this.setting( this.reduceMembers( attachment.toJSON() ) );
}
},
/**
* Reduces the attachment object to just the few desired members.
* @param {object} attachment An attachment object provided by the
* medial modal.
* @return {object} A reduced media object.
*/
reduceMembers: function( attachment ) {
var desired = [
'id',
'sizes',
'url'
],
output = {};
$.each( desired, function( i, key ){
output[key] = attachment[key];
});
return output;
},
/**
* Called on init and whenever a setting is changed. Shows the thumbnail
* when there is one or the upload button when there isn't.
*/
render: function() {
var value = this.setting();
if ( value && value.url ) {
this.$placeholder.hide();
if ( ! value.sizes || ! value.sizes.medium ) {
this.$img.attr( 'src', value.url );
} else {
this.$img.attr( 'src', value.sizes.medium.url );
}
this.$img.show();
this.$btnRemove.show();
this.$btnChange.show();
this.$btnAdd.hide();
} else {
this.$img.hide();
this.$placeholder.show();
this.$btnRemove.hide();
this.$btnChange.hide();
this.$btnAdd.show();
}
},
/**
* Called when the "Remove Image" link is clicked. Sets thes setting back
* to its default state.
* @param {object} event jQuery Event object from click event
*/
removeImg: function( event ) {
event.preventDefault();
this.setting( {
url: '',
id: 0
} );
}
});
})( this.wp, jQuery );

View file

@ -0,0 +1 @@
(function(a,c){var b=a.customize;b.controlConstructor.site_logo=b.Control.extend({ready:function(){var d=this.container.find(".customize-control-title").data();this.l10n=d.l10n;this.mime=d.mime;this.$imgContainer=c("#customize-control-site_logo .current");this.$btnContainer=c("#customize-control-site_logo .actions");this.$img=c('<img class="site-logo-thumbnail" />').prependTo(this.$imgContainer);this.$placeholder=c("<span>"+this.l10n.placeholder+"</span>").prependTo(this.$imgContainer);this.$btnAdd=c('<button type="button" class="button new">'+this.l10n.upload+"</button>").prependTo(this.$btnContainer);this.$btnChange=c('<button type="button" class="button change">'+this.l10n.change+"</button>").prependTo(this.$btnContainer);this.$btnRemove=c('<button type="button" class="button remove">'+this.l10n.remove+"</button>").prependTo(this.$btnContainer);_.bindAll(this,"removeImg","upload","render","pick");this.$btnAdd.on("click",this.upload);this.$btnChange.on("click",this.upload);this.$btnRemove.on("click",this.removeImg);this.setting.bind("change",this.render);this.render()},upload:function(d){d.preventDefault();if(!this.frame){this.initFrame()}this.frame.open()},initFrame:function(){this.frame=a.media({title:this.l10n.choose,library:{type:this.mime},button:{text:this.l10n.set},multiple:false});this.frame.on("select",this.pick)},pick:function(){var d=this.frame.state().get("selection").first().toJSON();d=this.reduceMembers(d);this.setting(d)},reduceMembers:function(f){var e=["id","sizes","url"],d={};c.each(e,function(h,g){d[g]=f[g]});return d},render:function(){var d=this.setting();if(d&&d.url){this.$placeholder.hide();if(!d.sizes||!d.sizes.medium){this.$img.attr("src",d.url)}else{this.$img.attr("src",d.sizes.medium.url)}this.$img.show();this.$btnRemove.show();this.$btnChange.show();this.$btnAdd.hide()}else{this.$img.hide();this.$placeholder.show();this.$btnRemove.hide();this.$btnChange.hide();this.$btnAdd.show()}},removeImg:function(d){d.preventDefault();this.setting({url:"",id:0})}})})(this.wp,jQuery);

View file

@ -0,0 +1,24 @@
/* global site_logo_header_classes */
/**
* JS for handling the "Display Header Text" setting's realtime preview.
*/
(function($){
var api = wp.customize,
$classes = site_logo_header_classes;
api( 'site_logo_header_text', function( value ) {
value.bind( function( to ) {
if ( true === to ) {
$( $classes ).css({
'position': 'static',
'clip': 'auto'
});
} else {
$( $classes ).css({
'position': 'absolute',
'clip': 'rect(1px 1px 1px 1px)'
});
}
});
});
})(jQuery);

View file

@ -0,0 +1 @@
!function(t){var i=wp.customize,o=site_logo_header_classes;i("site_logo_header_text",function(i){i.bind(function(i){t(o).css(!0===i?{position:"static",clip:"auto"}:{position:"absolute",clip:"rect(1px 1px 1px 1px)"})})})}(jQuery);

View file

@ -0,0 +1,43 @@
/**
* JS for handling the Site Logo real-time display in the Customizer preview frame.
*/
(function($){
var api = wp.customize,
$body, $anchor, $logo, size;
function cacheSelectors() {
$body = $( 'body' );
$anchor = $( '.site-logo-link' );
$logo = $( '.site-logo' );
size = $logo.attr( 'data-size' );
}
api( 'site_logo', function( value ){
value.bind( function( newVal ){
// grab selectors the first time through
if ( ! $body ) {
cacheSelectors();
}
// Let's update our preview logo.
if ( newVal && newVal.url ) {
// If the source was smaller than the size required by the theme, give the biggest we've got.
if ( ! newVal.sizes[ size ] ) {
size = 'full';
}
$logo.attr({
height: newVal.sizes[ size ].height,
width: newVal.sizes[ size ].width,
src: newVal.sizes[ size ].url
});
$anchor.show();
$body.addClass( 'has-site-logo' );
} else {
$anchor.hide();
$body.removeClass( 'has-site-logo' );
}
});
});
})(jQuery);

View file

@ -0,0 +1 @@
(function(d){var e=wp.customize,c,f,g,a;e("site_logo",function(e){e.bind(function(b){c||(c=d("body"),f=d(".site-logo-link"),g=d(".site-logo"),a=g.attr("data-size"));b&&b.url?(b.sizes[a]||(a="full"),g.attr({height:b.sizes[a].height,width:b.sizes[a].width,src:b.sizes[a].url}),f.show(),c.addClass("has-site-logo")):(f.hide(),c.removeClass("has-site-logo"))})})})(jQuery);

View file

@ -0,0 +1,235 @@
<?php
/**
* Social Links.
*
* This feature will only be activated for themes that declare their support.
* This can be done by adding code similar to the following during the
* 'after_setup_theme' action:
*
* add_theme_support( 'social-links', array(
* 'facebook', 'twitter', 'linkedin', 'tumblr', 'google_plus',
* ) );
*/
function jetpack_theme_supports_social_links() {
if ( current_theme_supports( 'social-links' ) && function_exists( 'publicize_init' ) ) {
new Social_Links();
}
}
add_action( 'init', 'jetpack_theme_supports_social_links', 30 );
if ( ! class_exists( 'Social_Links' ) ) {
class Social_Links {
/**
* The links the user set for each service.
*
* @var array
*/
private $links;
/**
* A Publicize object.
*
* @var Publicize
*/
private $publicize;
/**
* An array with all services that are supported by both Publicize and the
* currently active theme.
*
* @var array
*/
private $services = array();
/**
* An array of the services the theme supports
*
* @var array
*/
private $theme_supported_services = array();
/**
* Constructor.
*/
public function __construct() {
$theme_support = get_theme_support( 'social-links' );
/* An array of named arguments must be passed as the second parameter
* of add_theme_support().
*/
if ( empty( $theme_support[0] ) )
return;
$this->theme_supported_services = $theme_support[0];
$this->links = Jetpack_Options::get_option( 'social_links', array() );
$this->admin_setup();
add_filter( 'jetpack_has_social_links', array( $this, 'has_social_links' ) );
add_filter( 'jetpack_get_social_links', array( $this, 'get_social_links' ) );
foreach ( $theme_support[0] as $service ) {
add_filter( "pre_option_jetpack-$service", array( $this, 'get_social_link_filter' ) ); // get_option( 'jetpack-service' );
add_filter( "theme_mod_jetpack-$service", array( $this, 'get_social_link_filter' ) ); // get_theme_mod( 'jetpack-service' );
}
}
public function admin_setup() {
if ( ! current_user_can( 'manage_options' ) ) {
return;
}
if ( ! is_admin() && ! $this->is_customize_preview() ) {
return;
}
$this->publicize = publicize_init();
$publicize_services = $this->publicize->get_services( 'connected' );
$this->services = array_intersect( array_keys( $publicize_services ), $this->theme_supported_services );
add_action( 'publicize_connected', array( $this, 'check_links' ), 20 );
add_action( 'publicize_disconnected', array( $this, 'check_links' ), 20 );
add_action( 'customize_register', array( $this, 'customize_register' ) );
add_filter( 'sanitize_option_jetpack_options', array( $this, 'sanitize_link' ) );
}
/**
* Compares the currently saved links with the connected services and removes
* links from services that are no longer connected.
*
* @return void
*/
public function check_links() {
$active_links = array_intersect_key( $this->links, array_flip( $this->services ) );
if ( $active_links !== $this->links ) {
$this->links = $active_links;
Jetpack_Options::update_option( 'social_links', $active_links );
}
}
/**
* Add social link dropdown to the Customizer.
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
*/
public function customize_register( $wp_customize ) {
$wp_customize->add_section( 'jetpack_social_links', array(
'title' => __( 'Connect', 'jetpack' ),
'priority' => 35,
) );
foreach ( $this->services as $service ) {
$choices = $this->get_customize_select( $service );
if ( empty( $choices ) ) {
continue;
}
$wp_customize->add_setting( "jetpack_options[social_links][$service]", array(
'type' => 'option',
'default' => '',
) );
$wp_customize->add_control( "jetpack-$service", array(
'label' => $this->publicize->get_service_label( $service ),
'section' => 'jetpack_social_links',
'settings' => "jetpack_options[social_links][$service]",
'type' => 'select',
'choices' => $choices,
) );
}
}
/**
* Sanitizes social links.
*
* @param array $option The incoming values to be sanitized.
* @returns array
*/
public function sanitize_link( $option ) {
foreach ( $this->services as $service ) {
if ( ! empty( $option['social_links'][ $service ] ) )
$option['social_links'][ $service ] = esc_url_raw( $option['social_links'][ $service ] );
else
unset( $option['social_links'][ $service ] );
}
return $option;
}
/**
* Returns whether there are any social links set.
*
* @returns bool
*/
public function has_social_links() {
return ! empty( $this->links );
}
/**
* Return available social links.
*
* @returns array
*/
public function get_social_links() {
return $this->links;
}
/**
* Short-circuits get_option and get_theme_mod calls.
*
* @param string $link The incoming value to be replaced.
* @returns string $link The social link that we've got.
*/
public function get_social_link_filter( $link ) {
if ( preg_match( '/_jetpack-(.+)$/i', current_filter(), $matches ) && ! empty( $this->links[ $matches[1] ] ) )
return $this->links[ $matches[1] ];
return $link;
}
/**
* Puts together an array of choices for a specific service.
*
* @param string $service The social service.
* @return array An associative array with profile links and display names.
*/
private function get_customize_select( $service ) {
$choices = array(
'' => __( '&mdash; Select &mdash;', 'jetpack' )
);
$connected_services = $this->publicize->get_services( 'connected' );
if ( isset( $connected_services[ $service ] ) ) {
foreach ( $connected_services[ $service ] as $c ) {
$profile_link = $this->publicize->get_profile_link( $service, $c );
if ( false === $profile_link ) {
continue;
}
$choices[ $profile_link ] = $this->publicize->get_display_name( $service, $c );
}
}
if ( 1 === count( $choices ) ) {
return array();
}
return $choices;
}
/**
* Back-compat function for versions prior to 4.0.
*/
private function is_customize_preview() {
global $wp_customize;
return is_a( $wp_customize, 'WP_Customize_Manager' ) && $wp_customize->is_preview();
}
}
} // end if ( ! class_exists( 'Social_Links' )

View file

@ -0,0 +1,67 @@
<?php
/**
* Social Menu.
*
* This feature will only be activated for themes that declare their support.
* This can be done by adding code similar to the following during the
* 'after_setup_theme' action:
*
* add_theme_support( 'jetpack-social-menu' );
*/
/**
* Activate the Social Menu plugin.
*
* @uses current_theme_supports()
*/
function jetpack_social_menu_init() {
// Only load our code if our theme declares support
if ( ! current_theme_supports( 'jetpack-social-menu' ) ) {
return;
}
/*
* Social Menu description.
*
* Rename the social menu description.
*
* @module theme-tools
*
* @since 3.9.0
*
* @param string $social_menu_description Social Menu description
*/
$social_menu_description = apply_filters( 'jetpack_social_menu_description', __( 'Social Menu', 'jetpack' ) );
// Register a new menu location
register_nav_menus( array(
'jetpack-social-menu' => esc_html( $social_menu_description ),
) );
// Enqueue CSS
add_action( 'wp_enqueue_scripts', 'jetpack_social_menu_style' );
}
add_action( 'after_setup_theme', 'jetpack_social_menu_init', 99 );
/* Function to enqueue CSS */
function jetpack_social_menu_style() {
if ( has_nav_menu( 'jetpack-social-menu' ) ) {
wp_enqueue_style( 'jetpack-social-menu', plugins_url( 'social-menu/social-menu.css', __FILE__ ), array( 'genericons' ), '1.0' );
}
}
/* Create the function */
function jetpack_social_menu() {
if ( has_nav_menu( 'jetpack-social-menu' ) ) : ?>
<nav class="jetpack-social-navigation" role="navigation">
<?php
wp_nav_menu( array(
'theme_location' => 'jetpack-social-menu',
'link_before' => '<span class="screen-reader-text">',
'link_after' => '</span>',
'depth' => 1,
) );
?>
</nav><!-- .jetpack-social-navigation -->
<?php endif;
}

View file

@ -0,0 +1,180 @@
.jetpack-social-navigation ul {
display: block;
margin: 0 0 1.5em;
padding: 0;
}
.jetpack-social-navigation li {
display: inline-block;
margin: 0;
line-height: 1;
}
.jetpack-social-navigation a {
border: 0;
height: 1em;
text-decoration: none;
width: 1em;
}
.jetpack-social-navigation a:before {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
display: inline-block;
font-family: Genericons;
font-size: 1em;
font-style: normal;
font-weight: normal;
height: 1em;
line-height: 1;
speak: none;
text-decoration: inherit;
vertical-align: top;
width: 1em;
}
/* Default */
.jetpack-social-navigation a:before {
content: "\f415";
}
/* CodePen */
.jetpack-social-navigation a[href*="codepen.io"]:before {
content: "\f216";
}
/* Digg */
.jetpack-social-navigation a[href*="digg.com"]:before {
content: "\f221";
}
/* Dribbble */
.jetpack-social-navigation a[href*="dribbble.com"]:before {
content: "\f201";
}
/* Dropbox */
.jetpack-social-navigation a[href*="dropbox.com"]:before {
content: "\f225";
}
/* Email */
.jetpack-social-navigation a[href*="mailto:"]:before {
content: "\f410";
}
/* Facebook */
.jetpack-social-navigation a[href*="facebook.com"]:before {
content: "\f203";
}
/* Flickr */
.jetpack-social-navigation a[href*="flickr.com"]:before {
content: "\f211";
}
/* Foursquare */
.jetpack-social-navigation a[href*="foursquare.com"]:before {
content: "\f226";
}
/* GitHub */
.jetpack-social-navigation a[href*="github.com"]:before {
content: "\f200";
}
/* Google Plus */
.jetpack-social-navigation a[href*="plus.google.com"]:before {
content: "\f206";
}
/* Instagram */
.jetpack-social-navigation a[href*="instagram.com"]:before {
content: "\f215";
}
/* LinkedIn */
.jetpack-social-navigation a[href*="linkedin.com"]:before {
content: "\f208";
}
/* Path */
.jetpack-social-navigation a[href*="path.com"]:before {
content: "\f219";
}
/* Pinterest */
.jetpack-social-navigation a[href*="pinterest.com"]:before {
content: "\f210";
}
/* Pocket */
.jetpack-social-navigation a[href*="getpocket.com"]:before {
content: "\f224";
}
/* Polldaddy */
.jetpack-social-navigation a[href*="polldaddy.com"]:before {
content: "\f217";
}
/* Reddit */
.jetpack-social-navigation a[href*="reddit.com"]:before {
content: "\f222";
}
/* RSS Feed */
.jetpack-social-navigation a[href$="/feed/"]:before {
content: "\f413";
}
/* Skype */
.jetpack-social-navigation a[href*="skype:"]:before {
content: "\f220";
}
/* Spotify */
.jetpack-social-navigation a[href*="spotify.com"]:before {
content: "\f515";
}
/* StumbleUpon */
.jetpack-social-navigation a[href*="stumbleupon.com"]:before {
content: "\f223";
}
/* Tumblr */
.jetpack-social-navigation a[href*="tumblr.com"]:before {
content: "\f214";
}
/* Twitch */
.jetpack-social-navigation a[href*="twitch.tv"]:before {
content: "\f516";
}
/* Twitter */
.jetpack-social-navigation a[href*="twitter.com"]:before {
content: "\f202";
}
/* Vimeo */
.jetpack-social-navigation a[href*="vimeo.com"]:before {
content: "\f212";
}
/* Vine */
.jetpack-social-navigation a[href*="vine.co"]:before {
content: "\f517";
}
/* WordPress */
.jetpack-social-navigation a[href*="wordpress.com"]:before,
.jetpack-social-navigation a[href*="wordpress.org"]:before {
content: "\f205";
}
/* YouTube */
.jetpack-social-navigation a[href*="youtube.com"]:before {
content: "\f213";
}