Compare commits
No commits in common. "2ae40153fcca2e246665f9ad7a0d27a757fd1cfe" and "5df1252076c27b1683766c9743156b23bde26fa4" have entirely different histories.
2ae40153fc
...
5df1252076
|
|
@ -35,11 +35,8 @@ function carhop_setup()
|
||||||
add_theme_support('wp-block-styles');
|
add_theme_support('wp-block-styles');
|
||||||
|
|
||||||
add_theme_support('editor-styles');
|
add_theme_support('editor-styles');
|
||||||
add_theme_support('widgets');
|
|
||||||
|
|
||||||
add_editor_style('css/editor-style.css');
|
add_editor_style('css/editor-style.css');
|
||||||
|
add_theme_support('widgets');
|
||||||
add_post_type_support('page', 'excerpt');
|
|
||||||
// add_post_type_support( 'page', 'excerpt' );
|
// add_post_type_support( 'page', 'excerpt' );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -47,6 +44,33 @@ add_action('after_setup_theme', 'carhop_setup');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// ##### Menu Walker
|
||||||
|
// if (!function_exists('register_navwalker')) :
|
||||||
|
// function register_navwalker() {
|
||||||
|
// require('includes/navwalker.php');
|
||||||
|
// }
|
||||||
|
// endif;
|
||||||
|
// add_action('after_setup_theme', 'register_navwalker');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// ##### Walker to ReWrap li submenu parent with button instead of <a>
|
||||||
|
function wrap_parent_menu_item_buttons($output, $item, $depth, $args)
|
||||||
|
{
|
||||||
|
|
||||||
|
if ($args->theme_location === "primary" && in_array('menu-item-has-children', $item->classes, true)) {
|
||||||
|
$output = '<button type="button" class="menu-item-submenu-toggle" aria-expanded="false" aria-controls="sub-menu-' . $item->ID . '">' . $item->title . '</button>';
|
||||||
|
}
|
||||||
|
if ($args->theme_location === "footer" && in_array('menu-item-has-children', $item->classes, true)) {
|
||||||
|
$output = $item->title;
|
||||||
|
}
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
add_filter('walker_nav_menu_start_el', 'wrap_parent_menu_item_buttons', 10, 4);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------
|
/* ----------------------------------------------------------------
|
||||||
##### Enqueue Theme assets 🡒 Front
|
##### Enqueue Theme assets 🡒 Front
|
||||||
------------------------------------------------------------------*/
|
------------------------------------------------------------------*/
|
||||||
|
|
@ -114,3 +138,44 @@ function tailpress_asset($path)
|
||||||
|
|
||||||
return add_query_arg('time', time(), get_stylesheet_directory_uri() . '/' . $path);
|
return add_query_arg('time', time(), get_stylesheet_directory_uri() . '/' . $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------
|
||||||
|
##### Adds option 'li_class' to 'wp_nav_menu
|
||||||
|
------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
function tailpress_nav_menu_add_li_class($classes, $item, $args, $depth)
|
||||||
|
{
|
||||||
|
if (isset($args->li_class)) {
|
||||||
|
$classes[] = $args->li_class;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($args->{"li_class_$depth"})) {
|
||||||
|
$classes[] = $args->{"li_class_$depth"};
|
||||||
|
}
|
||||||
|
|
||||||
|
return $classes;
|
||||||
|
}
|
||||||
|
|
||||||
|
add_filter('nav_menu_css_class', 'tailpress_nav_menu_add_li_class', 10, 4);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ----------------------------------------------------------------
|
||||||
|
##### Adds option 'submenu_class' to 'wp_nav_menu'
|
||||||
|
------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
function tailpress_nav_menu_add_submenu_class($classes, $args, $depth)
|
||||||
|
{
|
||||||
|
if (isset($args->submenu_class)) {
|
||||||
|
$classes[] = $args->submenu_class;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($args->{"submenu_class_$depth"})) {
|
||||||
|
$classes[] = $args->{"submenu_class_$depth"};
|
||||||
|
}
|
||||||
|
|
||||||
|
return $classes;
|
||||||
|
}
|
||||||
|
|
||||||
|
add_filter('nav_menu_submenu_css_class', 'tailpress_nav_menu_add_submenu_class', 10, 3);
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,6 @@
|
||||||
@import './blocks/wp-block-heading.css';
|
@import './blocks/wp-block-heading.css';
|
||||||
@import './blocks/wp-block-list.css';
|
@import './blocks/wp-block-list.css';
|
||||||
@import './blocks/wp-block-table.css';
|
@import './blocks/wp-block-table.css';
|
||||||
@import './blocks/wp-block-details.css';
|
|
||||||
|
|
||||||
/* ########### LIBS ############ */
|
/* ########### LIBS ############ */
|
||||||
@import './libs/swiper.css';
|
@import './libs/swiper.css';
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
min-height: 60vh;
|
min-height: 60vh;
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
@apply !mt-0;
|
@apply mt-0;
|
||||||
}
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
|
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
.wp-block-details {
|
|
||||||
@apply border border-primary border-solid p-4;
|
|
||||||
|
|
||||||
summary {
|
|
||||||
@apply font-bold list-none flex items-center justify-between gap-2;
|
|
||||||
|
|
||||||
&::-webkit-details-marker,
|
|
||||||
&::marker {
|
|
||||||
@apply hidden;
|
|
||||||
content: ' ';
|
|
||||||
}
|
|
||||||
&:after {
|
|
||||||
transition: transform 0.5s ease-out;
|
|
||||||
content: ' ';
|
|
||||||
@apply w-10 h-10 block content-[''] bg-no-repeat bg-center bg-contain;
|
|
||||||
background-image: url('../resources/img/elements/select-drop-button.svg');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
&[open] {
|
|
||||||
summary:after {
|
|
||||||
@apply rotate-180;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user