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
// If is template | |
@if( is_page_template('resources/views/template-xx.blade.php') ) | |
Show this when is template! | |
@endif | |
// Navigation | |
@if( has_nav_menu('navigation') ) | |
{!! wp_nav_menu(['theme_location' => 'navigation', 'menu_class' => 'navigation_class']) !!} | |
@endif |
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
<div x-data="{id: 1}"> | |
<button @click="$dispatch('open-dropdown',{id})">Open</button> | |
</div> | |
<ul x-data="{ open: false }" | |
x-show="open" | |
@open-dropdown.window="if ($event.detail.id == 1) open = true" | |
@click.away="open = false"> | |
Dropdown Body | |
</ul> |
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 | |
global $post; | |
$ancestors = $post -> ancestors ?? ''; | |
if( isset($ancestors) ): | |
$ancestors = array_reverse($ancestors); | |
if( isset($ancestors[0]) ): | |
$current_toplevel_menu_id = $ancestors[0]; | |
else: | |
$current_toplevel_menu_id = $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 | |
$args = array( | |
'posts_per_page' => 99, | |
'post_status' => 'publish', | |
); | |
$posts = new WP_Query($args); | |
// Loop | |
if( $posts -> have_posts() ): | |
while( $posts -> have_posts() ): $posts -> the_post(); |
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
{% set items = [ | |
{ | |
"title": "Title", | |
}, | |
] %} | |
{% for item in items %} | |
{{ item.title }} | |
{% endfor %} |
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 | |
$image = get_sub_field('image'); | |
if( !empty($image) ): | |
$image_url = $image['sizes']['large']; | |
endif; | |
if($image_url): | |
?> | |
<img src="<?php echo $image_url; ?>" alt="" class=""> | |
<?php endif; ?> |
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 | |
$flexible_content = ''; | |
if( have_rows('partials', get_queried_object_id()) ): | |
while( have_rows('partials', get_queried_object_id()) ): the_row(); | |
$row_layouts = [ | |
'example-1', | |
'example-2', | |
'example-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
<?php | |
if( has_post_thumbnail() ): | |
$featured_thumb_id = get_post_thumbnail_id(); | |
$featured_thumb_url_array = wp_get_attachment_image_src( $featured_thumb_id, 'large', true ); | |
$featured_image = $featured_thumb_url_array[0]; | |
else: | |
$featured_image = get_template_directory_uri() . '/assets/images/default.jpg'; | |
endif; | |
?> |