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
/** | |
* Paginátor | |
* | |
* @global type $wp_query | |
* @global int $paged | |
* @param int $range Kolik stránek bude zobrazeno od aktuální stránky | |
* @param string $separator Oddělovací string mezi velkým množstvím stránek | |
* @return html | |
*/ | |
function paginator($range = 3, $separator = '...') { |
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
UPDATE wp_posts SET guid = REPLACE(guid, 'http://stararaurl.cz', 'http://novaurl.cz'); | |
UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://stararaurl.cz', 'http://novaurl.cz'); | |
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'http://stararaurl.cz', 'http://novaurl.cz'); | |
UPDATE wp_options SET option_value = REPLACE(option_value, 'http://stararaurl.cz', 'http://novaurl.cz'); |
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
// napojení pluginu Zalomení na ACF pole | |
function my_acf_format_value( $value, $post_id, $field ) { | |
$value = do_shortcode($value); | |
return Zalomeni::texturize($value); | |
} | |
// pouze pro text, textarea a wysiwyg | |
add_filter('acf/format_value/type=text', 'my_acf_format_value', 10, 3); | |
add_filter('acf/format_value/type=textarea', 'my_acf_format_value', 10, 3); | |
add_filter('acf/format_value/type=wysiwyg', 'my_acf_format_value', 10, 3); |
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
<files .htaccess> | |
Order allow,deny | |
Deny from all | |
</files> | |
<files readme.html> | |
Order allow,deny | |
Deny from all | |
</files> | |
<files license.txt> | |
Order allow,deny |
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
// zrušení načítání jQuery pro Contact Form 7 | |
add_filter( 'wpcf7_load_js', '__return_false' ); |
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
// titulek stránky | |
if ( is_404() ) { $page_title = "Chyba 404 - stránka nenalezena"; } // chyba 404 | |
elseif ( is_search() ) { $page_title = "Vyhledávání"; } // vyhledávání | |
elseif ( is_archive() ) { $page_title = str_replace("Archiv: ", "", get_the_archive_title()); } // zrušení dodatku Arichív | |
else { $page_title = get_the_title(); } // standardní titulek |
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
// zjištění aktuální kategorie pro rozdělení formulářů | |
$current_category = get_queried_object(); | |
$current_category = $current_category->post_parent; |
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
// přidání vlastních stylů | |
if ( ! function_exists( 'wpex_styles_dropdown' ) ) { | |
function wpex_styles_dropdown( $settings ) { | |
// Create array of new styles | |
$new_styles = array( | |
array( | |
'title' => __( 'Vlastní styly', 'wpex' ), | |
'items' => array( | |
array( |
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
// vytažení nadstránek | |
function getSuppages() { | |
global $post; | |
$pid = wp_get_post_parent_id($post->ID); | |
$pages = get_pages(array("parent" => $pid, "sort_column" => "menu_order")); | |
return $pages; | |
} |
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
// zkrácení znaků | |
function zkrat($string, $number) | |
{ | |
if ( mb_strlen($string) > $number ) | |
{ | |
$return = strpos( $string, ' ', $number ); | |
$return = substr( $string, 0, $return ); | |
$return = $return.'…'; | |
} |