function shiword_custom_background_init() { if (shiword_get_opt('shiword_custom_bg')) { add_action('wp_head', 'shiword_custom_background_plus_style'); add_action('admin_bar_menu', 'shiword_custom_background_admin_bar', 998); if (is_admin()) { $custom_background = new Shiword_Custom_Background(); } // the enhanced 'custom background' support } else { // the standard 'custom background' support $args = array('default-color' => '', 'default-image' => '', 'wp-head-callback' => 'shiword_custom_background_style', 'admin-head-callback' => '', 'admin-preview-callback' => ''); add_theme_support('custom-background', $args); } }
function shiword_get_opt($opt) { global $shiword_opt; if (isset($shiword_opt[$opt])) { return apply_filters('shiword_option_' . $opt, $shiword_opt[$opt], $opt); } $defopt = shiword_get_coa($opt); if (!$defopt) { return null; } if ($defopt['req'] == '' || shiword_get_opt($defopt['req'])) { return $defopt['default']; } else { return null; } }
/** * Register the widgets on startup. * * Widgets list is filterable. */ function shiword_register_widgets() { if (!is_blog_installed()) { return; } if (!shiword_get_opt('shiword_custom_widgets')) { return; } unregister_widget('WP_Widget_Recent_Comments'); $value = array('Shiword_Widget_Popular_Posts' => 1, 'Shiword_Widget_Latest_Commented_Posts' => 1, 'Shiword_Widget_Latest_Commentators' => 1, 'Shiword_Widget_User_Quick_Links' => 1, 'Shiword_Widget_Pop_Categories' => 1, 'Shiword_Widget_Social' => 1, 'Shiword_Widget_Recent_Posts' => 1, 'Shiword_Widget_Image_Details' => 1, 'Shiword_Widget_Share_This' => 1, 'Shiword_Widget_Post_Details' => 1, 'Shiword_Widget_Recent_Comments' => 1, 'Shiword_Widget_Clean_Archives' => 1); $widgets = apply_filters('shiword_filter_widgets', $value); foreach ($widgets as $widget => $is_on) { if ($is_on) { register_widget($widget); } } }
function shiword_mini_login() { $args = array('redirect' => home_url(), 'form_id' => 'sw-loginform', 'id_username' => 'sw-user_login', 'id_password' => 'sw-user_pass', 'id_remember' => 'sw-rememberme', 'id_submit' => 'sw-submit'); ?> <li class="ql_cat_li"> <a title="<?php esc_attr_e('Log in', 'shiword'); ?> " href="<?php echo esc_url(wp_login_url()); ?> "><?php _e('Log in', 'shiword'); ?> </a> <?php if (shiword_get_opt('shiword_qbar_minilogin') && !class_exists("siCaptcha")) { ?> <div id="sw_minilogin_wrap" class="cat_preview"> <div class="mentit"><?php _e('Log in', 'shiword'); ?> </div> <div id="sw_minilogin" class="solid_ul"> <?php wp_login_form($args); ?> <a id="closeminilogin" href="#"><?php _e('Close', 'shiword'); ?> </a> </div> </div> <?php } ?> </li> <?php }
<?php shiword_post_title(array('alternative' => $shiword_first_quote['quote'] ? '“' . $shiword_first_quote['quote'] . '”' : '')); ?> <?php shiword_hook_like_it(); ?> <?php shiword_extrainfo(array('auth' => $shiword_auth)); ?> <div class="storycontent"> <?php if (shiword_get_opt('shiword_xcont') == 1 || is_archive() || is_search()) { // compact view the_excerpt(); } else { // normal view the_content(); } ?> </div> <?php shiword_hook_entry_bottom(); ?> </div>
function setopt_admin_notice() { if (current_user_can('manage_options') && shiword_get_opt('version') < shiword_get_info('version')) { echo '<div class="updated"><p><strong>' . sprintf(__("Shiword theme says: \"Don't forget to set <a href=\"%s\">my options</a> and the header image!\" ", 'shiword'), get_admin_url() . 'themes.php?page=tb_shiword_functions') . '</strong></p></div>'; } }
<?php shiword_post_title(); ?> <?php shiword_hook_like_it(); ?> <?php shiword_extrainfo(); ?> <div class="storycontent"> <?php if (shiword_get_opt('shiword_xcont') == 0 && !is_archive() && !is_search()) { // normal view the_content(); } ?> </div> <?php shiword_hook_entry_bottom(); ?> </div> <div class="fixfloat"> </div> </div>
function get_layout($layout) { $layout = shiword_get_opt('shiword_rsideb_buddypress') ? 'narrow' : 'wide'; return $layout; }
function shiword_navbuttons($print = 1, $comment = 1, $feed = 1, $trackback = 1, $home = 1, $next_prev = 1, $up_down = 1) { global $post; if (!shiword_get_opt('shiword_navbuttons')) { return; } wp_reset_postdata(); $is_post = is_single() && !is_attachment() && !shiword_is_allcat(); $is_image = is_attachment() && !shiword_is_allcat(); $is_page = is_singular() && !is_single() && !is_attachment() && !shiword_is_allcat(); $is_singular = is_singular() && !shiword_is_allcat(); ?> <div id="navbuttons"> <?php // ------- Print ------- if (shiword_get_opt('shiword_navbuttons_print') && $print && $is_singular) { ?> <div class="minibutton"> <a rel="nofollow" href="<?php $query_vars['style'] = 'printme'; if (get_query_var('page')) { $query_vars['page'] = esc_html(get_query_var('page')); } if (get_query_var('cpage')) { $query_vars['cpage'] = esc_html(get_query_var('cpage')); } echo esc_url(add_query_arg($query_vars, get_permalink($post->ID))); ?> "> <span class="minib_img minib_print"> </span> </a> <span class="nb_tooltip"><?php _e('print preview', 'shiword'); ?> </span> </div> <?php } ?> <?php // ------- Leave a comment ------- if (shiword_get_opt('shiword_navbuttons_comment') && $comment && $is_singular && comments_open($post->ID) && !post_password_required()) { ?> <div class="minibutton"> <a href="#respond"> <span class="minib_img minib_comment"> </span> </a> <span class="nb_tooltip"><?php _e('Leave a comment', 'shiword'); ?> </span> </div> <?php } ?> <?php // ------- RSS feed ------- if (shiword_get_opt('shiword_navbuttons_feed') && $feed && $is_singular && comments_open($post->ID) && !post_password_required()) { ?> <div class="minibutton"> <a href="<?php echo esc_url(get_post_comments_feed_link($post->ID, 'rss2')); ?> "> <span class="minib_img minib_rss"> </span> </a> <span class="nb_tooltip"><?php _e('feed for comments on this post', 'shiword'); ?> </span> </div> <?php } ?> <?php // ------- Trackback ------- if (shiword_get_opt('shiword_navbuttons_trackback') && $trackback && $is_singular && pings_open()) { ?> <div class="minibutton"> <a href="<?php echo esc_url(get_trackback_url()); ?> " rel="trackback"> <span class="minib_img minib_track"> </span> </a> <span class="nb_tooltip"><?php _e('Trackback URL', 'shiword'); ?> </span> </div> <?php } ?> <?php // ------- Home ------- if (shiword_get_opt('shiword_navbuttons_home') && $home) { ?> <div class="minibutton"> <a href="<?php echo esc_url(home_url()); ?> "> <span class="minib_img minib_home"> </span> </a> <span class="nb_tooltip"><?php _e('Home', 'shiword'); ?> </span> </div> <?php } ?> <?php // ------- Back to parent post ------- if ($is_image) { ?> <?php if (!empty($post->post_parent)) { ?> <div class="minibutton"> <a href="<?php echo esc_url(get_permalink($post->post_parent)); ?> " rel="gallery"> <span class="minib_img minib_backtopost"> </span> </a> <span class="nb_tooltip"><?php esc_attr(printf(__('Return to %s', 'shiword'), get_the_title($post->post_parent))); ?> </span> </div> <?php } ?> <?php } ?> <?php // ------- Next post ------- if (shiword_get_opt('shiword_navbuttons_nextprev') && $next_prev && $is_post && get_next_post()) { ?> <div class="minibutton"> <a href="<?php echo esc_url(get_permalink(get_next_post())); ?> "> <span class="minib_img minib_npage"> </span> </a> <span class="nb_tooltip"><?php esc_attr(printf(__('Next Post', 'shiword') . ': %s', get_the_title(get_next_post()))); ?> </span> </div> <?php } ?> <?php // ------- Previous post ------- if (shiword_get_opt('shiword_navbuttons_nextprev') && $next_prev && $is_post && get_previous_post()) { ?> <div class="minibutton"> <a href="<?php echo esc_url(get_permalink(get_previous_post())); ?> "> <span class="minib_img minib_ppage"> </span> </a> <span class="nb_tooltip"><?php esc_attr(printf(__('Previous Post', 'shiword') . ': %s', get_the_title(get_previous_post()))); ?> </span> </div> <?php } ?> <?php // ------- Newer Posts ------- if (shiword_get_opt('shiword_navbuttons_newold') && $next_prev && !$is_singular && !shiword_is_allcat() && get_previous_posts_link()) { ?> <div class="minibutton hide-if-infinite"> <?php previous_posts_link('<span class="minib_img minib_ppages"> </span>'); ?> <span class="nb_tooltip"><?php echo __('Newer Posts', 'shiword'); ?> </span> </div> <?php } ?> <?php // ------- Older Posts ------- if (shiword_get_opt('shiword_navbuttons_newold') && $next_prev && !$is_singular && !shiword_is_allcat() && get_next_posts_link()) { ?> <div class="minibutton hide-if-infinite"> <?php next_posts_link('<span class="minib_img minib_npages"> </span>'); ?> <span class="nb_tooltip"><?php echo __('Older Posts', 'shiword'); ?> </span> </div> <?php } ?> <?php // ------- Top ------- if (shiword_get_opt('shiword_navbuttons_topbottom') && $up_down) { ?> <div class="minibutton"> <a href="#"> <span class="minib_img minib_top"> </span> </a> <span class="nb_tooltip"><?php _e('Top of page', 'shiword'); ?> </span> </div> <?php } ?> <?php // ------- Bottom ------- if (shiword_get_opt('shiword_navbuttons_topbottom') && $up_down) { ?> <div class="minibutton"> <a href="#footer"> <span class="minib_img minib_bottom"> </span> </a> <span class="nb_tooltip"><?php _e('Bottom of page', 'shiword'); ?> </span> </div> <?php } ?> <div class="fixfloat"> </div> </div> <?php }
function get_option($option) { return shiword_get_opt($option); }
function the_slider() { global $post; if (shiword_is_printpreview()) { return; } // no slider in print preview $posts_list = get_option('shiword_slideshow'); //get the selected posts list if (!isset($posts_list) || empty($posts_list)) { return; } // if no post is selected, exit $args = array('post__in' => $posts_list, 'post_type' => 'any', 'orderby' => 'post__in', 'post_status' => 'publish', 'no_found_rows' => true, 'posts_per_page' => -1, 'ignore_sticky_posts' => true); $r = new WP_Query($args); if ($r->have_posts()) { ?> <div id="sw_slider-wrap"> <div id="sw_sticky_slider"> <?php while ($r->have_posts()) { $r->the_post(); $post_author = !shiword_get_opt('shiword_sticky_author') ? '' : '<span class="sw-slider-auth">' . sprintf(__('by %s', 'shiword'), get_the_author()) . '</span>'; ?> <div class="sss_item"> <div class="sss_inner_item"> <a href="<?php echo esc_url(get_permalink()); ?> " title="<?php the_title_attribute(); ?> "> <?php echo shiword_get_the_thumb(array('width' => 120, 'height' => 120, 'class' => 'alignleft')); ?> </a> <div style="padding-left: 130px;"> <h2 class="storytitle"><a href="<?php echo get_permalink($post->ID); ?> " title="<?php the_title_attribute(); ?> "><?php the_title(); ?> </a></h2> <?php echo $post_author; ?> <div class="storycontent"> <?php the_excerpt(); ?> </div> </div> </div> </div> <?php } ?> </div> <div class="sw_slider-fade"> </div> <?php if ($r->post_count > 1) { ?> <div class="sw_slider-skip toright"> </div> <div class="sw_slider-skip toleft"> </div> <?php } ?> </div> <?php } wp_reset_postdata(); }