Custom Loop displays title, need to display custom field.
-
I have 3 custom loops running in my index at https://eddiemercerart.com
Basically they pull up posts and display the title which is linked to the individual posts.The first loop is a variation of a classic archives.php loop
The normal “get archives” command can only display titles though.
What I’m trying to do is “get posts” basically to pull a specific number of the latest posts. I need the code to allow me to get that specific number (not the default number I have set in the settings). Anyone have any idea how to make a loop that pulls a specific number of the latest posts?Also, what I intend to do is use said loop to pull up thumbnails as permalinks,
I need to hard code some of that and have the location for in the custom fields.
This is what I’m using in one of the custom loops currently that works:<a href="<?php the_permalink() ?>"><img src="https://eddiemercerart.com/small/<?php if ( function_exists('get_custom_field_value') ){ get_custom_field_value('path', true); } ?>.jpg" width="125" height="125" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" /></a>
I just need a loop I can throw that into that I request a specific number of the latest posts. Might be easy or it could be impossible, thought I’d ask here for help though before giving up.
- The topic ‘Custom Loop displays title, need to display custom field.’ is closed to new replies.