i’m new to wordpress, and i don’t know how to code.
I would like to make a page where all my animes are sorted by alphabet, like in this image
I’ve heard about the wp_list_category function, so i made a separate category for each anime. Now the problem is, i dont know how to use the function to make such alphabetic list, as i dont have any experience in coding, so can someone please tell me how to do that?
Thanks in advance
EDIT=
So i’ve did some search on google, and made this script, but it doesn’t work yet, can someone explain what’s wrong in this script?
<?php
$args = [
'category_name' => 'on-going',
'_name__like' => 'A'
$terms = get_terms( 'category', $args );
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
$count = count( $terms );
$i = 0;
$term_list="<p class="my_term-archive">";
foreach ( $terms as $term ) {
$i++;
$term_list .= '<a href="' . get_term_link( $term ) . '" title="' . sprintf( __( 'View all post filed under %s', 'my_localization_domain' ), $term->name ) . '">' . $term->name . '</a>';
if ( $count != $i ) {
$term_list .= ' · ';
}
else {
$term_list .= '</p>';
}
}
echo $term_list;
} ?>
This script looks so complicated for me, haven’t seen one like this before :/
EDIT:
Used this script in the end, thanks for all the help
$terms = get_terms('anime-on-going');
if ( !empty( $terms ) && !is_wp_error( $terms ) ){
$term_list = [];
foreach ( $terms as $term ){
$first_letter = strtoupper($term->name[0]);
$term_list[$first_letter][] = $term;
}
unset($term);
echo '<ul class="my_term-archive">';
foreach ( $term_list as $key=>$value ) {
echo '<h2 class="term-letter">' . $key . '</h2>';
foreach ( $value as $term ) {
echo '<li><a href="' . get_term_link( $term ) . '" title="' . sprintf(__('View all post filed under %s', 'my_localization_domain'), $term->name) . '">' . $term->name . '</a></li>';
}
}
echo '</ul>';
}