Simple Fields
Custom fields with a single post query (1 post)

  1. phantomdentist
    Posted 4 years ago #

    Am having trouble pulling in custom fields meta with a custom single post query

    Am using this to display a tooltip over a portfolio item with the portfolio items related testimonial within the tool tip.

    <?php if($portfolio_testimonial_id)
    						{ ?>
                            <div class="tooltip">
    						$post_id = $portfolio_testimonial_id;
    						$queried_post = get_post($post_id); ?>
    						<h3> <?php echo $queried_post->post_title; ?> </h3>
                            <p><?php echo $queried_post->post_content; ?> </p>
                            <?php $testimonial_author = simple_fields_get_post_value(get_the_id(), array(5, 1), true); ?>
    						<?php $testimonial_company = simple_fields_get_post_value(get_the_id(), array(5, 2), true); ?>
                            <?php $testimonial_url = simple_fields_get_post_value(get_the_id(), array(5, 3), true); ?>
                            <p class="testimonial_meta"><?php echo $testimonial_author; ?></p>
                            <p class="testimonial_meta"><?php echo $testimonial_company; ?></p>
                            <a href="http://<?php echo $testimonial_url; ?>"><?php echo $testimonial_url; ?></a>
                            <?php } ?>

    I know the code I have is not the correct code to do this but I can't find or discover the right code to use. I can't use a standard or custom loop as nested loops start to get really messy and waste a lot of time :)

    Any suggestions?



Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Simple Fields
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic