Instead of using wp_list_categories, perhaps you could add some code to your first attempt and divide your $categories array into two arrays, then output each array in its own column:
From Stackoverflow:
How to split/divide an array into 2 using php
In order to save the total number of posts each time one is created, I think you might need to hook into either acf/save_post or WordPress save_post, where you would update the total count.
Depending on your requirements, it may be easier to just use wp_count_posts when you need to display that number.
Not sure if these will be a complete solution, but here are a few things I noticed:
1. Try adding white space after your opening php tags:
<?php} else {?> // Incorrect
<?php } else { ?> // Correct
<?php}?> // Incorrect
<?php } ?> // Correct
2. Looks like you are missing a closing div for .img-container.
3. Does your code include an endwhile?
You may be able to achieve what you want with some combination of the ‘has_archive’ and ‘rewrite’ arguments when registering your custom post type. Perhaps something like this:
'has_archive' => 'about/employees',
'rewrite' => array(
'slug' => 'about/employees',
)
Don’t forget to flush your permalink settings after making this change, and watch out for URL conflicts if you already have a page at /about/employees/.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.