mirror of
https://github.com/10h30/trestle.git
synced 2026-07-11 18:56:07 +09:00
* Improve admin checkbox functionality.
* Add blockquote shortcode.
This commit is contained in:
@@ -170,8 +170,7 @@ function trestle_settings_box() {
|
||||
|
||||
<h4><?php _e( 'Primary Navigation', 'trestle' ) ?></h4>
|
||||
<p>
|
||||
<input type="checkbox" id="<?php echo GENESIS_SETTINGS_FIELD; ?>[trestle_auto_nav]" name="<?php echo GENESIS_SETTINGS_FIELD; ?>[trestle_auto_nav]" value="1" <?php checked( esc_attr( genesis_get_option( 'trestle_auto_nav' ) ), 1); ?> /> <label for="<?php echo GENESIS_SETTINGS_FIELD; ?>[trestle_auto_nav]"><?php _e( 'Automatically generate nav menu', 'trestle' ); ?></label>
|
||||
<label for="<?php echo GENESIS_SETTINGS_FIELD; ?>[trestle_auto_nav_depth]"><?php _e( 'with a depth of', 'trestle' ) ?>: </label>
|
||||
<input type="checkbox" id="<?php echo GENESIS_SETTINGS_FIELD; ?>[trestle_auto_nav]" name="<?php echo GENESIS_SETTINGS_FIELD; ?>[trestle_auto_nav]" value="1" <?php checked( esc_attr( genesis_get_option( 'trestle_auto_nav' ) ), 1); ?> /> <label for="<?php echo GENESIS_SETTINGS_FIELD; ?>[trestle_auto_nav]"><?php _e( 'Auto-generate primary navigation menu with published pages, to a depth of:', 'trestle' ); ?> </label>
|
||||
<select name="<?php echo GENESIS_SETTINGS_FIELD; ?>[trestle_auto_nav_depth]" />
|
||||
<option value="0" <?php selected( esc_attr( genesis_get_option( 'trestle_auto_nav_depth' ) ), '0' ); ?> >Unlimited</option>
|
||||
<?php
|
||||
|
||||
@@ -27,7 +27,10 @@ function trestle_shortcode_empty_paragraph_fix($content)
|
||||
add_filter('the_content', 'trestle_shortcode_empty_paragraph_fix');
|
||||
|
||||
/**
|
||||
* Columns - [col class="one-half first no-list-margin"] Contents [/col]
|
||||
* Columns
|
||||
*
|
||||
* Example:
|
||||
* [col class="one-half first no-list-margin"] Contents [/col]
|
||||
*
|
||||
* Classes:
|
||||
* - width (one-half, one-third, etc - uses native Genesis column classes in style.css)
|
||||
@@ -43,7 +46,10 @@ function trestle_column( $atts, $content = null ) {
|
||||
add_shortcode( 'col', 'trestle_column' );
|
||||
|
||||
/**
|
||||
* Buttons - [button href="url" class="class"]Text[/button]
|
||||
* Buttons
|
||||
*
|
||||
* Example:
|
||||
* [button href="url" class="class"]Text[/button]
|
||||
*/
|
||||
function trestle_button( $atts, $content = null ) {
|
||||
extract( shortcode_atts( array(
|
||||
@@ -53,3 +59,22 @@ function trestle_button( $atts, $content = null ) {
|
||||
return '<a class="button ' . $class . '" href="' . $href . '">' . do_shortcode( $content ) . '</a>';
|
||||
}
|
||||
add_shortcode( 'button', 'trestle_button' );
|
||||
|
||||
/**
|
||||
* Blockquote
|
||||
*
|
||||
* Example:
|
||||
* [blockquote name="Speaker" sub_text="Position, Company"]Contents[/blockquote]
|
||||
*/
|
||||
function trestle_blockquote( $atts, $content = null ) {
|
||||
extract( shortcode_atts( array(
|
||||
'name' => '',
|
||||
'sub_text' => '',
|
||||
), $atts ) );
|
||||
|
||||
$sub_text_html = $sub_text ? '<em>' . $sub_text . '</em>' : '';
|
||||
$cite = $name ? '<cite>' . $name . $sub_text_html . '</cite>' : '';
|
||||
|
||||
return '<blockquote><p>' . $content . $cite . '</p></blockquote>';
|
||||
}
|
||||
add_shortcode( 'blockquote', 'trestle_blockquote' );
|
||||
@@ -254,8 +254,17 @@ blockquote::before {
|
||||
|
||||
blockquote cite {
|
||||
display: block;
|
||||
margin-right: 10%;
|
||||
text-align: right;
|
||||
margin-top: 0.5em;
|
||||
margin-left: 60%;
|
||||
}
|
||||
|
||||
blockquote cite i,
|
||||
blockquote cite em {
|
||||
display: block;
|
||||
color: #959594;
|
||||
font-size: 0.8em;
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.content code {
|
||||
|
||||
Reference in New Issue
Block a user