How can I create a custom index page using custom fields?
-
Hi all. My website is located over at https://www.laajakuva.com/ We’re a Finnish online film magazine, currently containing around 455 articles. The problem? We’ve only got your basic categories to sort these articles by, ergo we can not provide our readers the accessibility our archive probably deserves.
I would like to craft an index page based on film titles. We would use custom fields on each article, adding the name of the film to said field. Then we need to make a page that pulls these titles, assigned to that field, and organizes them into an alphabetical list that can be displayed on our website.
Unfortunately I am more or less hot garbage in terms of coding, having only done the basic legwork to get this site running. I’ve added the custom field, and used a value called “elokuvakirjain” into which the writer enters the first name of the film, then I’ve made the following code in hopes that it would work. It has not, but here’s the code:
<?php get_header(); ?> <section class="content"> <?php get_template_part('inc/page-title'); ?> <div class="pad group"> <?php get_post_custom($meta_key=elokuvakirjain); ?> </div><!--/.pad--> </section><!--/.content--> <?php get_sidebar(); ?> <?php get_footer(); ?>
I’ve made a custom page with said code here, but it currently displays nothing: https://www.laajakuva.com/elokuvat/
So, basically, my question is twofold:
1) What am I doing wrong here?
2) If/when I get the list to that page, how do I alphabetize it so that it doesn’t just list everything, but rather have a clickable A-Z menu at the top of the content block so the reader can choose which letter they’d want?
- The topic ‘How can I create a custom index page using custom fields?’ is closed to new replies.