' . __( 'Log out', 'wordsmith' ) . ''; else $output = '' . __( 'Log in', 'wordsmith' ) . ''; return $output; } /* Shortcode to display query count and load time if the current user can edit themes. */ function framework_query_counter_shortcode() { if ( current_user_can( 'edit_theme_options' ) ) return sprintf( __( 'This page loaded in %1$s seconds with %2$s database queries.', 'wordsmith' ), timer_stop( 0, 3 ), get_num_queries() ); return ''; } /* Shortcode to display the site title with a link to the site. */ function framework_site_link_shortcode() { return '' . get_bloginfo( 'name' ) . ''; } /* Shortcode to display the site title. */ function framework_site_title_shortcode() { return '' . get_bloginfo( 'name' ) . ''; } /* Shortcode to display the current year. */ function framework_the_year_shortcode() { return '' . date( 'Y' ) . ''; } /* Shortcode to display a link to WordPress.org. */ function framework_wp_link_shortcode() { return '' . __( 'WordPress', 'wordsmith' ) . ''; } /* Shortcode to display a nav menu that has been created from the Menus screen in the admin. */ function framework_nav_menu_shortcode( $attr ) { $attr = shortcode_atts( array( 'after' => '', 'before' => '', 'container' => 'div', 'container_id' => '', 'container_class' => 'nav-menu', 'depth' => '1', 'echo' => false, 'fallback_cb' => '', 'link_before' => '', 'link_after' => '', 'menu' => '', 'menu_id' => '', 'menu_class' => '', 'theme_location' => '', 'walker' => '' ), $attr ); return wp_nav_menu( $attr ); } /* Shortcode to display a slideshow. */ function framework_slideshow_shortcode( $attr ) { global $post; /* Set up the defaults for the slideshow shortcode. */ $defaults = array( 'exclude' => '', 'include' => '', 'id' => $post->ID, 'numberposts' => -1, 'order' => 'DESC', 'orderby' => 'menu_order ID', 'size' => 'slideshow-image' ); $attr = shortcode_atts( $defaults, $attr ); /* Allow users to overwrite the default args. */ extract( apply_atomic( 'slideshow_shortcode_args', $attr ) ); /* Arguments for get_children(). */ $children = array( 'exclude' => absint( $exclude ), 'include' => absint( $include ), 'numberposts' => intval( $numberposts ), 'order' => $order, 'orderby' => $orderby, 'post_mime_type' => 'image', 'post_parent' => intval( $id ), 'post_status' => 'inherit', 'post_type' => 'attachment' ); /* Get image attachments. If none, return. */ $attachments = get_children( $children ); if ( empty( $attachments ) ) return ''; /* If is feed, leave the default WP settings. We're only worried about on-site presentation. */ if ( is_feed() ) { $output = "\n"; foreach ( $attachments as $id => $attachment ) $output .= wp_get_attachment_link( $id, $size, true ) . "\n"; return $output; } $slideshow = '
'; return apply_atomic( 'slideshow_shortcode', $slideshow ); } ?>