• Resolved michaelsliter

    (@michaelsliter)


    I’ve created a custom post type called Homes (homes) with several custom fields including home-type, square-footage, bedrooms, bathrooms. I also have a custom taxonomy setup for this post type called manufacturer.

    I’m trying to add these custom fields directly into my theme, specifically the loop that shows a list of all the current posts for this custom post type. I want to add some basic information below the title of each post, similar to where the date, author, category information would go on a blog feed. You can see a screenshot at https://paste.pics/10d65ef9794c122dd4d690f72f882606.

    I’ve tried the following but I can’t get it to work:
    <?php echo $homes->display( 'home-type' ); ?>

    Below is a snippet from the PHP file I’m editing:

    <?php } ?>
    				<div class="post_text">
    					<div class="post_text_inner">
    						<h2 itemprop="name" class="entry_title"><span itemprop="dateCreated" class="date entry_date updated"><?php the_time('d M'); ?><meta itemprop="interactionCount" content="UserComments: <?php echo get_comments_number(bridge_qode_get_page_id()); ?>"/></span> <a itemprop="url" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    						<div class="post_info">
    							<span class="time"><?php esc_html_e('Home Type','bridge'); ?> </span> <?php echo $homes->display( 'home-type' ); ?>

    Any help would be much appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Display Custom Fields in Theme Files’ is closed to new replies.