When using the recent posts widget on the home page, I’d like custom fields to be available. To instead of using:
<h2><a href=”<?php the_permalink() ?>” title=”<?php echo esc_attr(get_the_title() ? get_the_title() : get_the_ID()); ?>”><?php if ( get_the_title() ) the_title(); else the_ID(); ?></a></h2>
I’d like to
<?php echo get_post_meta($post->ID,’extra_title’,true); ?>
However, this leaves the title area blank.
Hi Kevin,
Because we do not use global $post in here, please use get_the_ID() instead of $post->ID,
Let me know if you need further assistance
Regards
Jennifer
Hi Kevin,
Because we do not use global $post in here, please use get_the_ID() instead of $post->ID,
Let me know if you need further assistance
Regards
Jennifer
Please login or Register to submit your answer