clean up and beginning to implement catfilter

This commit is contained in:
Jonas Heinrich 2020-06-19 16:15:06 +02:00
parent 5f67640161
commit 3cbde1b9f2
9 changed files with 36 additions and 829 deletions

View file

@ -92,94 +92,47 @@ get_header();
</div>
</div>
<div class="tx-indexedsearch-browsebox">
<p>
<?php
global $wp_query;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$post_count_start = (($paged -1) * 10) + 1;
$post_count_end = ((($paged -1) * 10) + $wp_query->post_count);
_e("Showing results from", 'kit') . _e(" <strong>" . $post_count_start . " to " . $post_count_end . "</strong>. Total results: <strong>" . $wp_query->found_posts. "</strong>");
?>
</p>
<div class="tx-indexedsearch-browsebox">
<?php the_posts_pagination( array(
'mid_size' => 2,
'prev_text' => __( '< Previous', 'kit' ),
'next_text' => __( 'Next >', 'kit' ),
'type' => 'list',
'before_page_number' => __('Page ', 'kit')
) ); ?>
</div>
</div>
</div>
<br>
<ul class="bestandliste">
<?php
<div class="container container-3-cols">
$args = array(
'cat' => $categories[0]->cat_ID,
'orderby' => 'title',
'order' => 'ASC',
'nopaging' => true,
);
$query = new WP_Query( $args );
<?php
if ( $query->have_posts() ) :
while ( $query->have_posts() ) :
$args = array(
'cat' => $categories[0]->cat_ID,
'orderby' => 'title',
'order' => 'ASC',
);
$query = new WP_Query( $args );
$query->the_post();
$first_char = substr( esc_html( get_the_title() ) ,0,1 );
if ( $query->have_posts() ) :
while ( $query->have_posts() ) :
$query->the_post();
?>
<div class="column">
<div class="teaser-box teaser-box-color-brand-secondary" id="c959">
<?php echo '<a href="' . esc_url( get_permalink() ) . '">'; ?>
<figure class="teaser-box-image">
<?php if ( has_post_thumbnail() ) { ?>
<img src="<?php echo get_the_post_thumbnail_url(); ?>">
<?php } else {
$custom_logo_id = get_theme_mod( 'kit_defaultimage' );
$logo = wp_get_attachment_image_src( $custom_logo_id , 'full' );
?>
<img src="<?php echo esc_url( $logo[0] ); ?>">
<?php } ?>
</figure>
if ($last_first_char === $first_char) {
echo '<li>
<a href="' . esc_url( get_permalink() ) . '">
' . esc_html( get_the_title() ) . '
</a>
<?php echo '<a href="' . esc_url( get_permalink() ) . '">'; ?>
<h3>
<?php echo esc_html( get_the_title() ); ?>
</h3>
</a>
<p>
<?php echo wp_strip_all_tags( get_the_excerpt(), true ); ?>
</p>
<?php echo '<a href="' . esc_url( get_permalink() ) . '" class="teaser-box-category-marker">'; ?>
Zum Beitrag
<div class="icon"></div>
</a>
</div>
</div>
<?php
endwhile;
wp_reset_postdata();
endif;
?>
</li>';
} else {
echo '</ul>
<ul class="bestandliste" id="' . $first_char . '">
<li>
<a href="' . esc_url( get_permalink() ) . '">
' . esc_html( get_the_title() ) . '
</a>
</li>';
$last_first_char = $first_char;
};
</div>
<div class="tx-indexedsearch">
<div class="tx-indexedsearch-browsebox">
<?php the_posts_pagination( array(
'mid_size' => 2,
'prev_text' => __( '< Previous', 'kit' ),
'next_text' => __( 'Next >', 'kit' ),
'type' => 'list',
'before_page_number' => __('Page ', 'kit')
) ); ?>
</div>
</div>
endwhile;
wp_reset_postdata();
endif;
?>
</ul>
</div>
</section>