Hallo zusammen,
ich habe auf einer Wordpressinstallation einen Service-Filter. http://www.jpkosmetik.de/services/
Jetzt ist es so, dass wenn ich auf "Alle" klicke, aber nicht alle erscheinen. Wie kann ich das ändern? Bei "Alle" möchte ich auch wirklich alle sehen. Bin leider noch Anfänger.
Hier der Code
<section id="<?php echo esc_attr($the_slug); ?>" data-panel="<?php echo esc_attr($the_slug); ?>" class="<?php echo esc_attr($tophead_layout); ?>"><article>
<div class="hlblock"><h1><?php echo esc_html($the_headline); ?></h1>
<?php
$filterargs = array(
'orderby' => 'name ASC',
'hide_empty' => 1
);
$include_ids = array();
if(!empty($tophead_services_categories)){
foreach ($tophead_services_categories as $tbck => $tbckv) {
$include_ids[] = $tbckv->term_id;
}
}
$filterargs['include'] = $include_ids;
$categories = get_terms( 'services-categories', $filterargs);
if(!empty($categories)){
?>
<ul class="filterlist" data-label="<?php _e('Filter: ','salon'); ?>" data-default="<?php _e('Alle','salon'); ?>">
<li><a class="filter active" data-filter="all"><?php _e('Alle','salon'); ?></a></li>
<?php
foreach ($categories as $kc => $c) {
?>
<li><a class="filter" data-filter=".cat-<?php echo esc_attr($c->slug); ?>"><?php echo esc_html($c->name); ?></a></li>
<?php
} // foreach
?>
</ul>
<?php
} // categories
?>
</div>
<div class="filteritems services">
<?php
$args = array(
'post_type' => 'services',
'post_status' => 'publish',
'posts_per_page' => '-1'
);
$q = new WP_Query( $args );
$posts = array();
if(!empty($q->posts)){
$posts = $q->posts;
}
wp_reset_postdata();
if(!empty($posts)){
foreach ($posts as $k => $p) {
$call_to_action_source = get_post_meta($p->ID, 'salon_cto_url_source', true);
$call_to_action_text = get_post_meta($p->ID, 'salon_cto_url_text', true);
$call_to_action_postpage = get_post_meta($p->ID, 'salon_cto_postpage', false);
$call_to_action_url = get_post_meta($p->ID, 'salon_cto_url', true);
$button_url = '';
if($call_to_action_source == 'postpage' && is_array($call_to_action_postpage)){
$button_url = get_the_permalink($call_to_action_postpage['0']);
}
else if($call_to_action_source == 'url'){
$button_url = $call_to_action_url;
}
else if($call_to_action_source == 'detail'){
$button_url = get_the_permalink($p->ID);
}
else if($call_to_action_source == 'booking'){
$booking_page = get_theme_mod( 'salon_booking_page',customizer_library_get_default('salon_booking_page'));
$button_url = get_the_permalink($booking_page);
}
$terms = get_the_terms($p->ID, 'services-categories');
$termlist = '';
$catlist = array();
if(!empty($terms)){
foreach ($terms as $tk => $t) {
$termlist .= 'cat-'.$t->slug.' ';
$catlist[] = $t->name;
}
}
$price = get_post_meta($p->ID, 'salon_service_price', true);
?><div class="item <?php echo esc_attr($termlist); ?>">
<h3><?php echo esc_html($p->post_title); ?></h3>
<p><?php echo xlane_trimtext($p->post_content,140); ?></p><a href="<?php echo esc_url($button_url); ?>"><i><?php echo esc_html($call_to_action_text); ?></i><span class="price"><?php echo esc_html($price); ?></span></a>
</div><?php
} // foreach
}// has posts
?>
</div>
</article></section>
Alles anzeigen