mirror of
https://github.com/10h30/trestle.git
synced 2026-07-11 18:56:07 +09:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 20e9f40b57 | |||
| 7d004ef9f0 | |||
| 51c177d85a | |||
| 69184c5f90 | |||
| b52e7e3387 | |||
| 59ec252bc4 | |||
| 331fd2e271 | |||
| b1d4ec9775 | |||
| 974933f5c2 | |||
| 0ba318f54a | |||
| 2b50585a14 | |||
| 4d104ab1f2 |
@@ -195,7 +195,7 @@ function trestle_body_classes( $classes ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add logo class.
|
// Add logo class.
|
||||||
if ( trestle_get_option( 'logo_url' ) || trestle_get_option( 'logo_url_mobile' ) ) {
|
if ( trestle_get_option( 'logo_id' ) || trestle_get_option( 'logo_id_mobile' ) ) {
|
||||||
$classes[] = 'has-logo';
|
$classes[] = 'has-logo';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,7 +268,7 @@ function trestle_do_logos( $title, $inside, $wrap ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( $logo_html ) {
|
if ( $logo_html ) {
|
||||||
$inside .= sprintf( '<a href="%s" title="%s">%s</a>',
|
$inside .= sprintf( '<a href="%s" title="%s" class="logos">%s</a>',
|
||||||
trailingslashit( home_url() ),
|
trailingslashit( home_url() ),
|
||||||
esc_attr( get_bloginfo( 'name' ) ),
|
esc_attr( get_bloginfo( 'name' ) ),
|
||||||
$logo_html
|
$logo_html
|
||||||
@@ -418,3 +418,68 @@ function trestle_read_more_link( $default_text ) {
|
|||||||
return $default_text;
|
return $default_text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*===========================================
|
||||||
|
* Helper Functions
|
||||||
|
===========================================*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if image has specified image size.
|
||||||
|
*
|
||||||
|
* @since 2.2.0
|
||||||
|
*
|
||||||
|
* @param int $image_id ID of image to check.
|
||||||
|
* @param string $image_size Slug of image size to check for.
|
||||||
|
*
|
||||||
|
* @return true|false Whether or not the image has the specified size generated.
|
||||||
|
*/
|
||||||
|
function trestle_image_has_size( $image_id, $image_size = null ) {
|
||||||
|
|
||||||
|
global $_wp_additional_image_sizes;
|
||||||
|
|
||||||
|
// Return with error if no image_size is specified.
|
||||||
|
if ( ! $image_size ) {
|
||||||
|
return new WP_Error( 'no_image_size_specified', __( 'Please specify an image size.', 'trestle' ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the attributes for the specified image size.
|
||||||
|
$image_size_atts = $_wp_additional_image_sizes[ $image_size ];
|
||||||
|
|
||||||
|
// Get data for specified image ID and size.
|
||||||
|
$img_data = wp_get_attachment_image_src( $image_id, $image_size );
|
||||||
|
|
||||||
|
// Check if the dimensions match.
|
||||||
|
if ( $img_data[1] == $image_size_atts['width'] && $img_data[2] == $image_size_atts['height'] ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if post is, or is a child of, a target post.
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*
|
||||||
|
* @param string $post_id Post ID to check.
|
||||||
|
* @param string $target_id Target post ID to check against.
|
||||||
|
*
|
||||||
|
* @return true|false
|
||||||
|
*/
|
||||||
|
function trestle_is_current_or_descendant_post( $post_id = '', $target_id = '' ) {
|
||||||
|
|
||||||
|
// If the current post is the target post, return true.
|
||||||
|
if ( $post_id == $target_id ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the current post is a descendant of the target post.
|
||||||
|
if ( in_array( $target_id, get_post_ancestors( $post_id ) ) ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -151,6 +151,10 @@ body {
|
|||||||
line-height: 1.625;
|
line-height: 1.625;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.bubble {
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
/* Used in the editor */
|
/* Used in the editor */
|
||||||
body.mce-content-body {
|
body.mce-content-body {
|
||||||
width: auto;
|
width: auto;
|
||||||
@@ -158,10 +162,7 @@ body.mce-content-body {
|
|||||||
float: none;
|
float: none;
|
||||||
-webkit-font-smoothing: auto !important;
|
-webkit-font-smoothing: auto !important;
|
||||||
font-smoothing: auto !important;
|
font-smoothing: auto !important;
|
||||||
}
|
background: #fff;
|
||||||
|
|
||||||
body.bubble {
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a,
|
a,
|
||||||
@@ -868,6 +869,35 @@ img.alignright,
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Text meant only for screen readers. */
|
||||||
|
.screen-reader-text {
|
||||||
|
clip: rect(1px, 1px, 1px, 1px);
|
||||||
|
position: absolute !important;
|
||||||
|
height: 1px;
|
||||||
|
width: 1px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.screen-reader-text:focus {
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
border-radius: 3px;
|
||||||
|
box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
|
||||||
|
clip: auto !important;
|
||||||
|
color: #21759b;
|
||||||
|
display: block;
|
||||||
|
font-size: 14px;
|
||||||
|
font-size: 0.875rem;
|
||||||
|
font-weight: bold;
|
||||||
|
height: auto;
|
||||||
|
left: 5px;
|
||||||
|
line-height: normal;
|
||||||
|
padding: 15px 23px 14px;
|
||||||
|
text-decoration: none;
|
||||||
|
top: 5px;
|
||||||
|
width: auto;
|
||||||
|
z-index: 100000; /* Above WP toolbar. */
|
||||||
|
}
|
||||||
|
|
||||||
/* Genesis
|
/* Genesis
|
||||||
--------------------------------------------- */
|
--------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user