function wrapChain(f) {
return function(...args) {
this._value = f.call(null, this._value, ...args)
return this
}
}
function chain(arr) {
return {
take: wrapChain(self.take),
skip: wrapChain(self.skip),
map: wrapChain(self.map),
foreach: wrapChain(self.foreach),
filter: wrapChain(self.filter),
_value: arr,
value: function() {
return this._value
}
}
}
<style>
.banner-top, .banner-bottom{
border: 2px solid red;
border-radius: 30px;
}
.banner-top{
border-bottom: none;
}
.banner-bottom{
border-top: none;
}
.banner-center{
margin: 0 -30px;
}
</style>
<div class="banner">
<div class="banner-top">
CONTENT TOP
</div>
<div class="banner-center">
<img src="..." alt="">
</div>
<div class="banner-bottom">
CONTENT BOTTOM
</div>
</div>
$category_id = get_query_var( 'cat' ); // Get current catgory ID
$category = get_term( $category_id, 'category' ); // Fetch category term object
// get_categories(['']);
// Now, we check if the category has a parent
// If it has, we use that ID
// If it doesn't have a parent, it is a parent category itself and we use its own ID
$parent = $category->parent ? $category->parent : $category_id;
$args = array(
'show_count' => false,
'hide_empty' => false,
'title_li' => '',
'show_option_none' => '',
'echo' => false
);
echo "parent: {$category->parent}";
// echo "category_id: $category_id";
// Show the children of parent category
if ( $category->parent ) {
$args['child_of'] = $category->parent;
$args['exclude'] = $category_id; // Don't display the current category in this list
}
else {
// $args['child_of'] = $category_id;
}
// $args['show_option_all'] = 'Все';
$args['hide_empty'] = true;
// Get the category list
$categories_list = wp_list_categories( $args );
if ( $categories_list ) {
?>
<div class="category-wrapper">
<ul class="child-categories">
<?php echo $categories_list; ?>
</ul>
</div>
<?php
}
data: () => ({
src: null,
}),
methods: {
onChange(e) {
const file = (e.target.files || e.dataTransfer.files)[0];
if (file) {
const reader = new FileReader();
reader.onload = () => this.src = reader.result;
reader.readAsDataURL(file);
}
},
},
<input type="file" @change="onChange">
esc_html_e( 'Time ', 'theme-name' ); // theme-name это и есть text-domain