Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Kill attachment, search, author, daily archive pages */
- add_action('template_redirect', 'bwp_template_redirect');
- function bwp_template_redirect()
- {
- global $wp_query, $post;
- if ( is_attachment() || is_month() || is_year() || is_day())
- {
- $wp_query->set_404();
- }
- if (is_feed())
- {
- $attachment = get_query_var('attachment');
- $attachment = (empty($attachment)) ? get_query_var('attachment_id') : $attachment;
- $day = get_query_var('day');
- if (!empty($attachment) || !empty($day) )
- {
- $wp_query->set_404();
- $wp_query->is_feed = false;
- }
- }
- }
- add_filter('widget_text', 'php_text', 99);
- function php_text($text) {
- if (strpos($text, '<' . '?') !== false) {
- ob_start();
- eval('?' . '>' . $text);
- $text = ob_get_contents();
- ob_end_clean();
- }
- return $text;
- }
- function sc_paste_code($atts, $content = null) {
- return '<code style="display: block;">' . $content . '</code>';
- }
- add_shortcode('c', 'sc_paste_code');
- ////////////////// Info box
- add_shortcode( 'infobox', 'func_infobox_sc' );
- function func_infobox_sc( $atts, $content = null ) {
- extract( shortcode_atts( array(
- 'title' => '',
- 'url' => '',
- ), $atts ) );
- $output = '
- <style type="text/css" media="screen"><!-- @import url(' . get_template_directory_uri() . '/infobox.css ); --></style>
- <div id="main-box">
- <div id="title-box"> ' . $atts['title'] . ' </div>
- <div id="content-box">' . do_shortcode($content) . '</div>
- <div id="copy-box"> <a> ' . esc_attr( $url ) . ' </a>
- </div></div>';
- return $output;
- }
- if ( function_exists('register_sidebar') )
- register_sidebar( array(
- 'name' => 'Optin',
- 'description' => '',
- 'id' => 'optin',
- 'before_widget' => '',
- 'after_widget' => '',
- 'before_title' => '',
- 'after_title' => '',
- ) );
- register_sidebar( array(
- 'name' => 'sidebar',
- 'description' => '',
- 'id' => 'sidebar',
- 'before_widget' => '',
- 'after_widget' => '',
- 'before_title' => '',
- 'after_title' => '',
- ) );
- if ( function_exists( 'add_theme_support' ) ){
- add_theme_support( 'post-thumbnails' );
- ////
- add_image_size( 'forFB', 500, 400, true );
- }
- // Miniaturka Linkiem do posta
- /*
- add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 );
- function my_post_image_html( $html, $post_id, $post_image_id ) {
- $html = '<a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '">' . $html . '</a>';
- return $html;
- }
- */
- // add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery', 'status', 'quote', 'image', 'attachment' ) );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement