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
def next_permutation(value) | |
values = value.to_s(10).split(//).sort | |
newValue = value + 1 | |
while false == newValue.to_s(10).split(//).sort.eql?(values) | |
newValue = newValue + 1 | |
end | |
return newValue | |
end |
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 | |
/** | |
* Exclude footer pages from search | |
* | |
* @param $query | |
* | |
* @return array | |
*/ | |
function your_theme_exclude_pages_from_search( $query ) { | |
if ( $query->is_search ) { |
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
<a href="<?php echo get_permalink( get_page_by_title( 'Contact' ) ); ?>"> | |
<?php _e( 'Contact', 'your_text_domain' ); ?> | |
</a> |
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 | |
define('ICL_DONT_LOAD_LANGUAGE_SELECTOR_CSS', true); |
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
function your_theme_exclude_pages_from_search( $query ) { | |
$query->set( 'post__not_in', PAGE_ID_HERE ); | |
return $query; | |
} | |
add_filter( 'pre_get_posts', 'your_theme_exclude_pages_from_search' ); |
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 my_theme_fix_extra_caption_padding( $atts ) { | |
if ( ! empty( $atts['width'] ) ) { | |
$atts['width'] -= 10; | |
} | |
return $atts; | |
} | |
add_filter( 'shortcode_atts_caption', 'my_theme_fix_extra_caption_padding' ); |
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
function my_theme_init() { | |
register_taxonomy_for_object_type( 'category', 'page' ); | |
} | |
add_action( 'init', 'my_theme_init' ); |
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
(function ($) { | |
$(function () { | |
$('iframe').wrap("<div class='iframe-responsive-container'></div>"); | |
}); | |
})(jQuery); |
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
.iframe-responsive-container { | |
position: relative; | |
padding-bottom: 56.25%; | |
padding-top: 30px; | |
height: 0; | |
} | |
.iframe-responsive-container iframe { | |
position: absolute; | |
left: 0; |
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 your_theme_styles() { | |
wp_enqueue_style( | |
'style', | |
get_stylesheet_directory_uri() . '/style.css', | |
false, | |
date( 'dmYhi', filemtime( get_stylesheet_directory() . '/style.css' ) ) | |
); | |
} |
OlderNewer