function display() { if (!FastfoodOptions::get_opt('fastfood_breadcrumb')) { return; } echo $this->get_the_breadcrumb(); }
public static function menu_primary() { if (FastfoodOptions::get_opt('fastfood_primary_menu')) { ?> <?php fastfood_hook_menu_primary_before(); ?> <div id="menu-primary-container" class="menu-primary-container menu-container"> <?php fastfood_hook_menu_primary_top(); ?> <?php wp_nav_menu(array('container' => false, 'menu_id' => 'menu-primary', 'menu_class' => 'nav-menu', 'fallback_cb' => 'Fastfood_Nav_Menus::menu_primary_fallback', 'theme_location' => 'primary')); ?> <?php fastfood_hook_menu_primary_bottom(); ?> </div> <?php fastfood_hook_menu_primary_after(); ?> <?php } }
/** * Print a reminder message for set the options after the theme is installed or updated */ function setopt_admin_notice() { $screen = get_current_screen(); if (current_user_can('manage_options') && $screen->id !== 'appearance_page_fastfood_options' && version_compare(FastfoodOptions::get_opt('version', '0'), fastfood_get_info('version'), '<')) { echo '<div class="update-nag"><strong>' . sprintf(__('%1$s theme says: Dont forget to set <a href="%2$s">my options</a>!', 'fastfood'), 'Fastfood', get_admin_url() . 'themes.php?page=' . $this->option_name) . '</strong></div>'; } }
function slider_filter($output) { $display_header_slider = get_theme_mod('display_header_slider', ''); $slides = get_uploaded_header_images(); $js_loaded = FastfoodOptions::get_opt('fastfood_jsani'); if ($display_header_slider && $slides && $js_loaded) { $output = $this->build_slider($slides); } return $output; }
/** * Is the primary widget area visible? * * @return bool */ function fastfood_use_sidebar() { static $bool; if (!isset($bool)) { $bool = true; if (!is_singular() && !FastfoodOptions::get_opt('fastfood_rsidebindexes') || is_page() && !FastfoodOptions::get_opt('fastfood_rsidebpages') || is_attachment() && !FastfoodOptions::get_opt('fastfood_rsidebattachments') || is_single() && !FastfoodOptions::get_opt('fastfood_rsidebposts')) { $bool = false; } $bool = apply_filters('fastfood_use_sidebar', $bool); } return $bool; }
function init() { if (is_admin() || fastfood_is_mobile() || fastfood_is_printpreview()) { return; } if (!FastfoodOptions::get_opt('fastfood_cust_comrep') || !FastfoodOptions::get_opt('fastfood_jsani')) { add_action('comment_form_before', array($this, 'load_standard_scripts')); } else { add_action('comment_form_before', array($this, 'load_custom_scripts')); add_action('comment_form_after', array($this, 'hide_form')); } }
/** * Grab the actions hooked to the 'fastfood_hook_builder' hook and add each one to its section * * @access private * @since Fastfood 0.37 */ private function grab_sort_n_hang() { global $wp_filter; if (isset($wp_filter['fastfood_hook_builder'])) { $sorted = (array) json_decode(FastfoodOptions::get_opt('fastfood_builder_order')); foreach ($wp_filter['fastfood_hook_builder'][10] as $element) { $id = $element['accepted_args']['id']; $section = $element['accepted_args']['section']; $callback = $element['function']; $label = $element['accepted_args']['label'] ? $element['accepted_args']['label'] : $element['accepted_args']['id']; $priority = false === ($offset = array_search($id, $sorted)) ? 10 + absint($element['accepted_args']['priority']) : 10 + $offset; if (!isset(self::$supported_sections[$section])) { continue; } self::$order[$section]['label'] = self::$supported_sections[$section]; self::$order[$section]['elements'][$priority] = array('id' => $id, 'callback' => $callback, 'priority' => $priority, 'label' => $label); add_action("fastfood_hook_{$section}", $callback, $priority); } foreach (self::$order as $s_key => $section) { ksort($section['elements']); self::$order[$s_key]['elements'] = $section['elements']; } } }
/** * Add classes to <body> */ function fastfood_body_classes($classes) { $classes[] = 'ff-no-js'; $classes[] = 'layout-2'; if (FastfoodOptions::get_opt('fastfood_tinynav')) { $classes[] = 'tinynav-support'; } if (FastfoodOptions::get_opt('fastfood_basic_animation_captions')) { $classes[] = 'fading-captions'; } if (FastfoodOptions::get_opt('fastfood_rsideb_position') == 'left') { $classes[] = 'left-sidebar'; } return $classes; }
/** * Checks the requirements of a control and returns its visibility accordingly * * @since Fastfood 0.37 * * @param WP_Customize_Control $wp_control WP_Customize_Control instance. */ function control_visibility($wp_control) { preg_match_all('/fastfood_options\\[(.+)\\]/', $wp_control->id, $keys); if (!isset($keys[1][0])) { $option = isset($this->theme_mods[$wp_control->id]) ? $this->theme_mods[$wp_control->id] : false; } else { $option = isset($this->theme_options[$keys[1][0]]) ? $this->theme_options[$keys[1][0]] : false; } if (!$option || !isset($option['control']['require']) || !$option['control']['require']) { return true; } foreach ((array) $option['control']['require'] as $option) { preg_match_all('/fastfood_options\\[(.+)\\]/', $option, $o_keys); if (isset($o_keys[1][0]) && !FastfoodOptions::get_opt($o_keys[1][0])) { return false; } elseif (!isset($o_keys[1][0]) && !get_theme_mod($option)) { return false; } } return true; }
function show_title($title) { if (FastfoodOptions::get_opt('fastfood_hide_buddypress_title')) { $title = ''; } return $title; }
function get_option($option) { return FastfoodOptions::get_opt($option); }
/** * Register all of the default WordPress widgets on startup. */ function fastfood_widgets_init() { if (!is_blog_installed()) { return; } if (!FastfoodOptions::get_opt('fastfood_custom_widgets')) { return; } register_widget('Fastfood_Widget_Popular_Posts'); register_widget('Fastfood_Widget_Latest_Commented_Posts'); register_widget('Fastfood_Widget_Latest_Commentators'); register_widget('Fastfood_Widget_Pop_Categories'); register_widget('Fastfood_Widget_Social'); register_widget('Fastfood_Widget_Besides'); register_widget('Fastfood_Widget_Recent_Posts'); register_widget('Fastfood_Widget_Image_Exif'); register_widget('Fastfood_Widget_Clean_Archives'); register_widget('Fastfood_Widget_Post_Details'); register_widget('Fastfood_Widget_Font_Resize'); unregister_widget('WP_Nav_Menu_Widget'); register_widget('Fastfood_Widget_Nav_Menu'); }
fastfood_featured_title(array('alternative' => get_the_time(get_option('date_format')), 'fallback' => sprintf(__('gallery #%s', 'fastfood'), get_the_ID()))); break; } ?> <?php fastfood_extrainfo(); ?> <?php fastfood_hook_post_content_before(); ?> <div class="entry-content"> <?php switch (FastfoodOptions::get_opt('fastfood_post_formats_gallery_content')) { case 'presentation': fastfood_gallery_preview(); break; case 'content': the_content(); break; case 'excerpt': the_excerpt(); break; } ?> </div> <?php fastfood_hook_post_content_after();
fastfood_featured_title(array('alternative' => get_the_time(get_option('date_format')), 'fallback' => sprintf(__('post #%s', 'fastfood'), get_the_ID()))); break; } ?> <?php fastfood_extrainfo(); ?> <?php fastfood_hook_post_content_before(); ?> <div class="entry-content"> <?php switch (FastfoodOptions::get_opt('fastfood_postexcerpt')) { case 0: //the content the_content(); break; case 1: //the excerpt the_excerpt(); break; } ?> </div> <?php fastfood_hook_post_content_after(); ?>
/** * Add attachment description. (required for the Thickbox feature) * * @see wp_get_attachment_link() */ function fastfood_get_attachment_link($markup = '', $id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false) { if (!FastfoodOptions::get_opt('fastfood_jsani') || !FastfoodOptions::get_opt('fastfood_gallery_preview')) { return $markup; } $id = intval($id); $_post = get_post($id); if (empty($_post) || 'attachment' != $_post->post_type || !($url = wp_get_attachment_url($_post->ID))) { return __('Missing Attachment', 'fastfood'); } if ($permalink) { $url = get_attachment_link($_post->ID); } $post_title = esc_attr($_post->post_excerpt ? $_post->post_excerpt : $_post->post_title); if ($text) { $link_text = $text; } elseif ($size && 'none' != $size) { $link_text = wp_get_attachment_image($id, $size, $icon); } else { $link_text = ''; } if (trim($link_text) == '') { $link_text = $_post->post_title; } return "<a href='{$url}' title='{$post_title}'>{$link_text}</a>"; }
/** * Enqueues front-end custom CSS. * * @since Fastfood 0.37 * * @see wp_add_inline_style() */ function fastfood_custom_css() { $attributes['fastfood_custom_css'] = wp_strip_all_tags(FastfoodOptions::get_opt('fastfood_custom_css')); $attributes['fastfood_allowed_tags'] = FastfoodOptions::get_opt('fastfood_allowed_tags') ? 'block' : 'none'; $css = <<<CSS \t/* custom CSS */ \t.form-allowed-tags { \t\tdisplay: {$attributes['fastfood_allowed_tags']}; \t} \t{$attributes['fastfood_custom_css']} CSS; wp_add_inline_style('fastfood', $css); }
function header_style_front() { if (fastfood_is_mobile()) { return; } if ('blank' == get_header_textcolor()) { $style = 'display: none;'; } else { $style = 'color: #' . get_header_textcolor() . ';'; } $header_text_background = ltrim(get_theme_mod('header_text_background', 'transparent'), '#'); $header_text_background_rgba = $header_text_background; $filter = ''; if ($header_text_background_rgba && 'transparent' != $header_text_background_rgba) { $header_text_background_rgba = fastfood_hex2rgb($header_text_background_rgba); $header_text_background_rgba = vsprintf('rgba( %1$s, %2$s, %3$s, 0.7)', $header_text_background_rgba); $filter = "filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b3{$header_text_background}', endColorstr='#b3{$header_text_background}',GradientType=0 ); /* IE6-9 */"; } ?> <style type="text/css"> #site-heading a, #site-heading { <?php echo $style; ?> } #site-image { max-height: <?php echo absint(FastfoodOptions::get_opt('fastfood_head_h')); ?> px; } .has-header-image #site-heading { background-color: <?php echo $header_text_background_rgba; ?> ; <?php echo $filter; ?> } </style> <?php }
/** * Add data to localized js variable * * @since Fastfood 0.37 */ function localize_script($data) { //$data['script_modules'][] = 'boobs'; $data['script_modules'][] = 'featured_slideshow'; $data['featuredSlideshowSpeed'] = absint(FastfoodOptions::get_opt('fastfood_featured_content_speed')); $data['featuredSlideshowPause'] = absint(FastfoodOptions::get_opt('fastfood_featured_content_speed')) + absint(FastfoodOptions::get_opt('fastfood_featured_content_pause')); return $data; }
/** * Display a small login module * * @since Fastfood 0.37 */ function mini_login() { if (!FastfoodOptions::get_opt('fastfood_qbar_minilogin') || class_exists("siCaptcha")) { return; } $args = array('redirect' => home_url()); ?> <div id="minilogin" class="quickbar-panel-subcontent"> <div class="quickbar-panel-title"><?php _e('Log in', 'fastfood'); ?> </div> <div class="preview"> <?php wp_login_form($args); ?> </div> </div> <?php }