This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('aioseop_robots_meta','klausk_noindex'); | |
function klausk_noindex($string) { | |
global $wp_query; | |
if ($wp_query->is_category && $wp_query->query_vars['cat']==1) { | |
$string = str_replace('noindex','index',$string); | |
} | |
return $string; | |
} | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: JSFiddle oEmbed | |
Plugin URI: http://klausk.aruno.lt/jsfiddle/ | |
Description: Embed JSFiddle into posts | |
Version: 1.0 | |
Author: IdeaG | |
Author URI: http://klausk.aruno.lt | |
License: GPL2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('pre_get_posts', 'klausk_category_post_types'); | |
function klausk_category_post_types($query) { | |
if((is_category() && $query->is_main_query()) { | |
$post_type = get_query_var('post_type'); | |
if($post_type) | |
$post_type = $post_type; | |
else | |
$post_type = array('post','resort'); | |
$query->set('post_type',$post_type); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function klausk_resort() { | |
$args = array( | |
'public' => true, | |
'hierarchical' => false, | |
'label' => __('Resort','tema') | |
); | |
register_post_type( 'resort', $args ); | |
register_taxonomy_for_object_type('category', 'resort'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function klausk_page_category() { | |
register_taxonomy_for_object_type('category', 'page'); | |
} | |
add_action( 'init', 'klausk_page_category' ); | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.tiny_coffee_form button { | |
background-color:#000; /* pasirinkite norimą spalvą */ | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$slider_show = get_option('general_enable_slider'); | |
$slider_auto = get_option('general_auto_play'); | |
$slider_speed = get_option('general_slider_delay'); | |
$slider_animation_time = get_option('general_animation_time'); | |
if(empty($slider_speed)) {$slider_speed = "4000";} | |
if(empty($slider_animation_time)) {$slider_animation_time = "1000";} | |
if($slider_show[0] == 'yes') : | |
// if($slider_show[0] == 'yes') { | |
?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'publish_to_trash', 'klausk_delete_menu_item' ); | |
function klausk_delete_menu_item($post) { | |
// tik puslapiams | |
if( $post->post_type !== 'page' ) | |
return; | |
// jei tema nepalaiko meniu - nieko daryti nereikia | |
if ( ! current_theme_supports( 'menus' ) ) { return; } | |
// trinamas meniu punktas | |
_wp_delete_post_menu_item($post->ID); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$post_id = 500 | |
$p = get_post($post_id); | |
$args = array( | |
'date_query' => array( | |
'before' => $p->post_date, | |
// 'after' => $p->post_date | |
'inclusive' => true, | |
), | |
'exclude'=>$post_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Klausk_Filter { | |
private $id = 0; | |
private $compare = '<'; | |
public function __construct($id,$compare = '<') { | |
$this->id = intval($id); | |
$this->compare = $compare; | |
} | |
public function filter($where){ | |
$where .= " AND `ID` {$this->compare} {$this->id}"; |