Skip Navigation

[Resolved] Custom Field Types Not Displaying

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 6 years ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

This topic contains 8 replies, has 2 voices.

Last updated by nicholasF-4 6 years ago.

Assisted by: Nigel.

Author
Posts
#657299
Screenshot.png

I am trying to: Create a new post and display custom field information on single page and loop

Link to a page where the issue can be seen: hidden link

I expected to see: Correct custom field information

Instead, I got: Wrong custom field information

In the case of the first two posts, JPC Group and Conair Corporation, both are showing data from the post I COPIED to create them rather than the custom field data actually in those posts. If I create a NEW post without copying an existing post, the custom field data simply does not show up.

#657490

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Nicholas

How are you outputting the fields?

You are editing a theme PHP template file directly and using types_render_field? Or something else?

#657591

I think I created a child theme and directly edited the PHP in this case.

#657633

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Yes, but what PHP did you add, and where did you add it?

#657779

Here is entire single page template. Keep in mind this was working perfectly when I first built the site.

<?php
get_header();
global $smof_data;
$name = (types_render_field("name", array('raw' => true) ));
$address1 = (types_render_field("address1", array('raw' => true) ));
$address2 = (types_render_field("address2", array('raw' => true) ));
$city = (types_render_field("city", array('raw' => true) ));
$state = (types_render_field("state", array('raw' => true) ));
$zip = (types_render_field("zip", array('raw' => true) ));
$website = (types_render_field("website", array('raw' => true) ));
$email = (types_render_field("email", array('raw' => true) ));
$phone = (types_render_field("phone", array('raw' => true) ));
$fax = (types_render_field("fax", array('raw' => true) ));

?>
<!-- Container Main Start-->
<?php //Sidebar Show/Hide Condition Class
$post_sidebar_position = get_post_meta( $post->ID , 'zt_sidebar_position', true );
$post_sidebar_left_position = get_post_meta( $post->ID , 'zt_sidebar_left_position', true );
$post_sidebar_right_position = get_post_meta( $post->ID , 'zt_sidebar_right_position', true );

$admin_blogposts_sidebar_position = $smof_data["blogposts_sidebar_position"];
$admin_blogposts_left_sidebar = $smof_data["blogposts_left_sidebar"];
$admin_blogposts_right_sidebar = $smof_data["blogposts_right_sidebar"];

if($post_sidebar_position == 'default'){

if($admin_blogposts_sidebar_position == 'left'){
$sidebar_position_class = 'hassidebar left';
}elseif($admin_blogposts_sidebar_position == 'right'){
$sidebar_position_class = 'hassidebar right';
}elseif($admin_blogposts_sidebar_position == 'both'){
$sidebar_position_class = 'hassidebar double_sidebars';
}elseif($admin_blogposts_sidebar_position == 'none'){
$sidebar_position_class = 'nosidebars';
}

}else{

if($post_sidebar_position == 'left'){
$sidebar_position_class = 'hassidebar left';
}elseif($post_sidebar_position == 'right'){
$sidebar_position_class = 'hassidebar right';
}elseif($post_sidebar_position == 'both'){
$sidebar_position_class = 'hassidebar double_sidebars';
}elseif($post_sidebar_position == 'none'){
$sidebar_position_class = 'nosidebars';
}
}
// post_title_position
$post_title_position = $smof_data['post_title_position'];
$post_title_alignment = $smof_data['post_title_alignment'];
$post_separator_show_hide = $smof_data['post_separator_show_hide'];
?>

<?php
$panel_post_meta = get_post_meta( $post->ID , 'zt_post_meta', true );
$adminpanel_post_meta = $smof_data['post_meta'];

// Post Meta
if($panel_post_meta == 'default'){
if($adminpanel_post_meta == 1){
$post_meta = true;

}else{$post_meta = false;
}

}elseif($panel_post_meta == 'yes' || $panel_post_meta == 'no'){
if($panel_post_meta == 'yes'){
$post_meta = true;
}else{
$post_meta = false;
}
}else{
$post_meta = true;
}

?>

<div class="container-main <?php if(isset($sidebar_position_class)){echo $sidebar_position_class;}?>">
<div class="zolo-container">
<div class="inner-content">
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php /* The loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
$show_hide_featured = get_post_meta($post->ID, 'zt_show_hide_featured', true );
$post_video = get_post_meta($post->ID, 'zt_video', true );

$format_quote = has_post_format( 'quote' );
$format_audio = has_post_format( 'audio' );
?>

<article id="post-<?php the_ID(); ?>" <?php post_class( 'post' ); ?>>
<div class="blogpage_content">

<?php if($post_title_position == 'above'){
zplus_entry_meta($post_meta,$format_quote, $post_title_alignment,$post_title_position);
}?>

<?php //Post Thumbnail Start ?>

<?php //if not quote Start
if (!$format_quote){?>
<?php
if( ! post_password_required($post->ID) ):
if( ( $smof_data['featured_images_single'] && $show_hide_featured != 'hide' ) || ( ! $smof_data['featured_images_single'] && $show_hide_featured == 'show' ) ):
if( zplus_number_of_featured_images() > 0 || $post_video ): ?>

<div class="post_flexslide">

<ul class="slides">
<?php if($post_video){ ?>
<li class="slide"><div class="zolo_fluid_video_wrapper"> <?php echo $post_video; ?></div>
<?php } ?>
<?php if ( has_post_thumbnail() ) {
$attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'blog_large');
?>
<!--<li class="slide">-->

<div style="width:260px; float:left; padding-right: 24px;"><img src="<?php echo $attachment_image[0]; ?>" /></div>
<div><span style="font-size:24px;"><?php echo $name; ?></span><br>
<span style="font-size:16px;"><?php echo $address1; ?></span><br>
<?php
//If we have a address2, place it on the page
if ($address2 != "") {

echo "<span style=\"font-size:16px;\">" . $website . "</span><br>";
}
?>
<span style="font-size:16px;"><?php echo $city . ", " . $state . " " . $zip ?></span><br>

<?php
//If we have a phone, place it on the page
if ($phone != "") {

echo "<span style=\"font-size:16px;\">Phone: " . $phone . "</span><br>";
}
?>

<?php
//If we have a fax, place it on the page
if ($fax != "") {

echo "<span style=\"font-size:16px;\">Fax: " . $fax . "</span><br>";
}
?>

<?php
//If we have a website, place it on the page
if ($website != "") {

echo "<span style=\"font-size:16px;\">Website: <a href=\"" . $website . "\" target=\"_blank\">" . $website . "</a></span><br>";
}
?>

<!---->
<?php } ?>
<?php
$i = 2;
while($i <= 5):
$attachment_new_id = kd_mfi_get_featured_image_id('featured-image-'.$i, 'post');
if($attachment_new_id):
$attachment_image = wp_get_attachment_image_src($attachment_new_id, 'blog_large'); ?>
<li class="slide"><img src="<?php echo $attachment_image[0]; ?>" alt="<?php echo get_post_meta($attachment_new_id, '_wp_attachment_image_alt', true); ?>" />

<?php endif; $i++; endwhile; ?>

</div>

<?php endif; ?>
<?php endif; ?>
<?php endif; ?>

<?php } ?>

<?php //Post Thumbnail End ?>

<?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'zplus' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?>
</div>
<!-- .entry-content -->
<?php
edit_post_link( __( 'Edit', 'zplus' ), '<span class="edit-link">', '</span>' );
?>
<!-- .entry-meta -->
</div>
</div>
</div>
</article>

<?php //Share Box Start ?>
<?php if( ( $smof_data['social_sharing_box'] && get_post_meta($post->ID, 'zt_share_box', true ) != 'no' ) || ( ! $smof_data['social_sharing_box'] && get_post_meta($post->ID, 'zt_share_box', true) == 'yes' ) ): ?>
<?php $nofollow = ' rel="nofollow"'; ?>
<div class="share-box">

<h4><?php echo __('Share This Story, Choose Your Platform!', 'z-one'); ?></h4>
<ul class="social-networks">
<?php if($smof_data['sharing_facebook']): ?>
<li class="facebook"> <a href="hidden link;?php the_permalink(); ?>&p[title]=<?php the_title(); ?>" target="_blank"<?php echo $nofollow; ?>><i class="fa fa-facebook"></a>
<?php endif; ?>
<?php if($smof_data['sharing_twitter']): ?>
<li class="twitter"> <a href="hidden link;?php the_title(); ?> <?php the_permalink(); ?>" target="_blank"<?php echo $nofollow; ?>><i class="fa fa-twitter"></a>
<?php endif; ?>
<?php if($smof_data['sharing_linkedin']): ?>
<li class="linkedin"> <a href="hidden link;?php the_permalink(); ?>&title=<?php the_title(); ?>" target="_blank"<?php echo $nofollow; ?>><i class="fa fa-linkedin"></a>
<?php endif; ?>
<?php if($smof_data['sharing_tumblr']): ?>
<li class="tumblr"> <a href="hidden link;?php echo urlencode(get_permalink()); ?>&name=<?php echo urlencode($post->post_title); ?>&description=<?php echo urlencode(get_the_excerpt()); ?>" target="_blank"<?php echo $nofollow; ?>> <i class="fa fa-tumblr"> </a>
<?php endif; ?>
<?php if($smof_data['sharing_google']): ?>
<li class="google"> <a href="hidden link;?php the_permalink(); ?>" onclick="javascript:window.open(this.href,
'', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');return false;" target="_blank"<?php echo $nofollow; ?>> <i class="fa fa-google-plus"> </a>
<?php endif; ?>
<?php if($smof_data['sharing_pinterest']): ?>
<li class="pinterest">
<?php $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); ?>
<a href="hidden link;?php echo urlencode(get_permalink()); ?>&description=<?php echo urlencode($post->post_title); ?>&media=<?php echo urlencode($full_image[0]); ?>" target="_blank"<?php echo $nofollow; ?>> <i class="fa fa-pinterest"> </a>
<?php endif; ?>
<?php if($smof_data['sharing_email']): ?>
<li class="email"> <a href="mailto:?subject=<?php the_title(); ?>&body=<?php the_permalink(); ?>"> <i class="fa fa-envelope-o"> </a>
<?php endif; ?>

</div>
<?php endif; ?>
<?php //Share Box End ?>

<?php // Previous/next post navigation Start ?>
<?php if( ( $smof_data['blog_pn_nav'] && get_post_meta($post->ID, 'zt_post_pagination', true ) != 'no' ) || ( ! $smof_data['blog_pn_nav'] && get_post_meta($post->ID, 'zt_post_pagination', true) == 'yes' ) ): ?>
<?php zplus_post_nav(); ?>
<?php endif; ?>
<?php // Previous/next post navigation End ?>

<?php //Related Post Start ?>

<?php if( ( $smof_data['related_posts'] && get_post_meta($post->ID, 'zt_related_posts', true ) != 'no' ) || ( ! $smof_data['related_posts'] && get_post_meta($post->ID, 'zt_related_posts', true) == 'yes' ) ): ?>
<?php $related_post = zplus_get_related_posts($post->ID); ?>

<?php if($related_post->have_posts()){ ?>
<div class="related_post_area">
<h3><?php echo __('Related Posts', 'zplus'); ?></h3>
<ul class="related_post_list">
<?php while($related_post->have_posts()): $related_post->the_post(); ?>
<li class="fitrow_col">
<div class="entry-thumbnail">
<?php
//zilla_likes
if( function_exists('zilla_likes') ){
echo '<span class="zilla_likes_box"> ';
zilla_likes();
echo '</span>';
}
?>

<a href="<?php the_permalink(); ?>">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'blog_medium' ); } ?>
</a>
</div>
<?php the_title( '<h4><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h4>' ); ?>

<?php endwhile;wp_reset_query();?>

</div>
<?php } ?>

<?php endif; ?>
<?php //Related Post End ?>

<?php //Comments Area Start ?>

<?php if( ( $smof_data['blog_comments'] && get_post_meta($post->ID, 'zt_post_comments', true ) != 'no' ) ||
( ! $smof_data['blog_comments'] && get_post_meta($post->ID, 'zt_post_comments', true) == 'yes' ) ): ?>
<?php
wp_reset_query();
if ( comments_open() || get_comments_number() ) {
comments_template();
}
?>
<?php endif; ?>
<?php //Comments Area End ?>
<?php endwhile; ?>
</div>
<!-- #content -->
</div>
<!-- #primary -->

<?php
//Single Post sidebar
if($post_sidebar_position == 'default'){
if($admin_blogposts_sidebar_position != 'none' || $admin_blogposts_sidebar_position != ''){
if($admin_blogposts_sidebar_position == 'left' || $admin_blogposts_sidebar_position == 'both'){
echo '<div class="sidebar sidebar_container_1 left" role="complementary"><div class="widget-area">';
generated_dynamic_sidebar($admin_blogposts_left_sidebar);
echo '</div></div>';
}
if($admin_blogposts_sidebar_position == 'right' || $admin_blogposts_sidebar_position == 'both'){
echo '<div class="sidebar sidebar_container_2 right" role="complementary"><div class="widget-area">';
generated_dynamic_sidebar($admin_blogposts_right_sidebar);
echo '</div></div>';
}
}
}else{
if($post_sidebar_position == 'left' || $post_sidebar_position == 'both'){
echo '<div class="sidebar sidebar_container_1 left" role="complementary"><div class="widget-area">';
generated_dynamic_sidebar($post_sidebar_left_position );
echo '</div></div>';
}
if($post_sidebar_position == 'right' || $post_sidebar_position == 'both'){
echo '<div class="sidebar sidebar_container_2 right" role="complementary"><div class="widget-area">';
generated_dynamic_sidebar($post_sidebar_right_position );
echo '</div></div>';
}

}
?>
</div>
</div>
</div>
<?php get_footer(); ?>

#673894

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Hi Nicholas

You are not inside the Loop so the types functions don't have the right context of the current post to get the custom field from.

Given that you are just retrieving the raw values you might as well use get_post_meta, which will be more efficient.

First make the $post object global and then provide $post->ID as the post ID argument for get_post_meta, like so:

global $post;
$name = get_post_meta( $post->ID, 'wpcf-name', true );
// etc.

Note the 'wpcf-' prefix on the field slug if you are accessing Types fields directly from wp_postmeta.

#674909

I'll give that a try. But it isn't working IN the loop either. Here is my code for that:

-------------------------------------------

<?php
get_header();

?>
<!-- Container Main Start-->
<?php
global $smof_data;
$blog_layout_column_class = '';
$adminpanel_post_meta = $smof_data['post_meta'];

//Sidebar Show/Hide Condition Class
if($smof_data["blog_archive_sidebar_position"] == 'left'){

$sidebar_position_class = 'hassidebar left';

}elseif($smof_data["blog_archive_sidebar_position"] == 'right'){

$sidebar_position_class = 'hassidebar right';

}elseif($smof_data["blog_archive_sidebar_position"] == 'both'){

$sidebar_position_class = 'hassidebar double_sidebars';

}elseif($smof_data["blog_archive_sidebar_position"] == 'none'){

$sidebar_position_class = 'nosidebars';
}

$blog_archive_sidebar_position = $smof_data["blog_archive_sidebar_position"];
$blog_archive_left_sidebar = $smof_data["blog_archive_left_sidebar"];
$blog_archive_right_sidebar = $smof_data["blog_archive_right_sidebar"];

?>
<?php
//Blog Archive Layout Class
//Blog Archive Layout Masonry Class
//Blog Archive Layout Thumbnail Size
if($smof_data["blog_archive_layout"] == 'small'){

$blog_layout_masonry_class = 'blog_layout_small fitrow_row';
$blog_archive_layout_thumb = 'blog_medium';

}elseif($smof_data["blog_archive_layout"] == 'medium'){

$blog_layout_masonry_class = 'blog_layout_medium fitrow_row';
$blog_archive_layout_thumb = 'blog_medium';

}elseif($smof_data["blog_archive_layout"] == 'large'){

$blog_layout_masonry_class = 'blog_layout_large fitrow_row';
$blog_archive_layout_thumb = 'blog_large';

}elseif($smof_data["blog_archive_layout"] == 'grid'){

$blog_layout_masonry_class = 'blog_layout_grid fitrow_row';
$blog_archive_layout_thumb = 'blog_medium';

}elseif($smof_data["blog_archive_layout"] == 'masonry'){

$blog_layout_masonry_class = 'blog_layout_masonry';
$blog_archive_layout_thumb = 'full';

}

//Default Image
if($blog_archive_layout_thumb == 'full' || $blog_archive_layout_thumb == 'small' || $blog_archive_layout_thumb == 'blog_medium'){
$default_image = '<img src="'.get_template_directory_uri().'/images/post_thumb/blog_medium.jpg">';
}elseif($blog_archive_layout_thumb == 'blog_large'){
$default_image = '<img src="'.get_template_directory_uri().'/images/post_thumb/blog_large.jpg">';
}
?>
<?php

//Blog Layout Columns Class
if($smof_data["blog_archive_layout"] == 'grid' || $smof_data["blog_archive_layout"] == 'masonry'){

if($smof_data["blog_grid_columns"] == '2'){
$blog_layout_column_class = 'blog_column_2';

}elseif($smof_data["blog_grid_columns"] == '3'){
$blog_layout_column_class = 'blog_column_3';

}elseif($smof_data["blog_grid_columns"] == '4'){
$blog_layout_column_class = 'blog_column_4';

}elseif($smof_data["blog_grid_columns"] == '5'){
$blog_layout_column_class = 'blog_column_5';

}elseif($smof_data["blog_grid_columns"] == '6'){
$blog_layout_column_class = 'blog_column_6';
}

}

//Masonry
if($smof_data["blog_archive_layout"] == 'masonry'){
$masonry_item = 'masonry-item';
}else{
$masonry_item = 'fitrow_columns';
}

// post_title_position
$post_title_position = $smof_data['post_title_position'];
$post_title_alignment = $smof_data['post_title_alignment'];
$post_separator_show_hide = $smof_data['post_separator_show_hide'];
$blog_post_design = $smof_data['blog_post_design'];

?>

<div class="container-main blog_layout <?php echo $sidebar_position_class?>">
<div class="zolo-container">
<div class="inner-content">
<div id="primary" class="content-area">
<?php if ( have_posts() ) : ?>
<?php if(category_description()): ?>
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="post-content post_category_des" style="float:left; width:100%;"> <?php echo category_description(); ?> </div>
</div>
<?php endif; ?>
<div id="content" class="site-content <?php echo $blog_layout_masonry_class.' '.$blog_layout_column_class.' blog_layout_'.$blog_post_design;;?>">
<?php /* The loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php

$name = (types_render_field("name", array('raw' => true) ));
$address1 = (types_render_field("address1", array('raw' => true) ));
$address2 = (types_render_field("address2", array('raw' => true) ));
$city = (types_render_field("city", array('raw' => true) ));
$state = (types_render_field("state", array('raw' => true) ));
$zip = (types_render_field("zip", array('raw' => true) ));
$website = (types_render_field("website", array('raw' => true) ));
$email = (types_render_field("email", array('raw' => true) ));
$phone = (types_render_field("phone", array('raw' => true) ));
$fax = (types_render_field("fax", array('raw' => true) ));

$post_video = get_post_meta( get_the_ID(), 'zt_video', true );
$image_rollover_icons_show_hide = get_post_meta( get_the_ID(), 'zt_image_rollover_icons_show_hide', true );
$panel_post_meta = get_post_meta( get_the_ID() , 'zt_post_meta', true );

// Post Meta
if($panel_post_meta == 'default'){
if($adminpanel_post_meta == 1){
$post_meta = true;
}else{
$post_meta = false;}
}elseif($panel_post_meta == 'yes' || $panel_post_meta == 'no'){
if($panel_post_meta == 'yes'){
$post_meta = true;
}else{
$post_meta = false;
}
}else{
$post_meta = true;
}
?>

<?php $format_quote = has_post_format( 'quote' );
$format_audio = has_post_format( 'audio' ); ?>

<article id="post-<?php the_ID(); ?>" <?php post_class( $masonry_item ); ?>>
<div class="blogpage_content">

<?php if($post_title_position == 'above'){
zplus_entry_meta($post_meta,$format_quote, $post_title_alignment,$post_title_position);
}?>

<?php //if not quote Start
if (!$format_quote && !$format_audio){?>
<?php
if( zplus_number_of_featured_images() > 0 || $post_video ){?>
<div class="post_flexslider">
<?php
//zilla_likes
if( function_exists('zilla_likes') ){
echo '<span class="zilla_likes_box"> ';
zilla_likes();
echo '</span>';
}
?>

<ul class="slides">
<?php if($post_video){ ?>
<li class="slide">
<div class="zolo_fluid_video_wrapper"> <?php echo $post_video; ?></div>

<?php } ?>
<?php
if ( has_post_thumbnail() ) {
$attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), $blog_archive_layout_thumb);
?>
<li class="slide"><img src="<?php echo $attachment_image[0]; ?>" />
<?php if($image_rollover_icons_show_hide == 'show' || $image_rollover_icons_show_hide == ''){?>
<span class="overlay"></span> <span class="zolo_blog_icons"> <span class="icons_center"> <a class="zolo_blog_icon blog_zoom_icon fancybox" href="<?php echo $attachment_image[0]; ?>"> <i class="fa fa-search-plus"> </a> <a class="zolo_blog_icon blog_link_icon" href="<?php the_permalink(); ?>"> <i class="fa fa-link"> </a> </span> </span>
<?php }?>

<?php } ?>
<?php
$i = 2;
while($i <= 5):
$attachment_new_id = kd_mfi_get_featured_image_id('featured-image-'.$i, 'post');
if($attachment_new_id){?>
<?php $attachment_image = wp_get_attachment_image_src($attachment_new_id, $blog_archive_layout_thumb); ?>
<li class="slide"><img src="<?php echo $attachment_image[0]; ?>" alt="<?php echo get_post_meta($attachment_new_id, '_wp_attachment_image_alt', true); ?>" />
<?php if($image_rollover_icons_show_hide == 'show' || $image_rollover_icons_show_hide == ''){?>
<span class="overlay"></span> <span class="zolo_blog_icons"> <span class="icons_center"> <a class="zolo_blog_icon blog_zoom_icon fancybox" href="<?php echo $attachment_image[0]; ?>"><i class="fa fa-search-plus"></a> <a class="zolo_blog_icon blog_link_icon" href="<?php the_permalink(); ?>"><i class="fa fa-link"></a> </span> </span>
<?php }?>

<?php } $i++; endwhile; ?>

</div>
<?php }else{

if($smof_data["blog_archive_layout"] != 'large'){
echo '<div class="post_flexslider">';
//zilla_likes
if( function_exists('zilla_likes') ){
echo '<span class="zilla_likes_box"> ';
zilla_likes();
echo '</span>';
}

echo '<ul class="slides">';
echo '

  • '.$default_image.'
  • ';
    if($image_rollover_icons_show_hide == 'show'){?>
    <span class="overlay"></span> <span class="zolo_blog_icons"> <span class="icons_center"> <a class="zolo_blog_icon blog_link_icon" href="<?php the_permalink(); ?>"><i class="fa fa-link"></a> </span> </span>
    <?php }
    echo '</div>';
    }
    } ?>

    <?php
    //Post Thumbnail End ?>
    <?php }?>

    <?php if($post_title_position == 'below'){
    zplus_entry_meta($post_meta,$format_quote, $post_title_alignment,$post_title_position);
    }?>

    <div class="blog_text_area"><left><span style="font-size:16px;"><?php echo $address1; ?></span><br>
    <?php

    //If we have a address2, place it on the page
    if ($address2 != "") {

    echo "<span style=\"font-size:16px;\">" . $address2 . "</span><br>";
    }
    ?>
    <span style="font-size:16px;"><?php echo $city . ", " . $state . " " . $zip ?></span><br>

    <?php
    //If we have a phone, place it on the page
    if ($phone != "") {

    echo "<span style=\"font-size:16px;\">Phone: " . $phone . "</span><br>";
    }
    ?>

    <?php
    //If we have a fax, place it on the page
    if ($fax != "") {

    echo "<span style=\"font-size:16px;\">Fax: " . $fax . "</span><br>";
    }
    ?>

    <?php
    //If we have a website, place it on the page
    if ($website != "") {

    echo "<span style=\"font-size:16px;\"><a href=\"" . $website . "\" target=\"_blank\">Website</a></span><br>";
    }
    ?></left>
    <div class="post-content">

    <?php
    //if quote Start
    if ( $format_quote){ ?>
    <div class="entry-content">
    <?php
    //zilla_likes
    if( function_exists('zilla_likes') ){
    echo '<span class="zilla_likes_box"> ';
    zilla_likes();
    echo '</span>';
    }
    ?>
    <a href="<?php the_permalink(); ?> ">
    <?php the_content(); ?>
    </a>
    </div>
    <?php }elseif($format_audio){?>
    <div class="entry-content">
    <?php the_content(); ?>
    </div>
    <?php }else{ ?>

    <?php the_excerpt(); ?>

    <?php }?>

    <!-- .entry-content -->

    <?php //if not quote Start
    if (!$format_quote){
    if($smof_data['post_social_sharing_show_hide'] == 'show'){
    get_template_part('framework/social_sharing');
    }

    edit_post_link( __( 'Edit', 'zplus' ), '<span class="edit-link">', '</span>' );
    }?>

    </div>
    </div>
    </div>
    <?php if($post_separator_show_hide == 'show'){echo '<div class="post_separator"><img src="'.$smof_data['post_separator_img'].'"/></div>';} ?>
    <hr><br>
    </article>

    <?php endwhile; ?>
    </div>
    <?php //zplus_paging_nav(); ?>
    <?php zplus_pagination(); ?>
    <?php else : ?>
    <div id="content" class="site-content" role="main">
    <?php get_template_part( 'content', 'none' ); ?>
    </div>
    <?php endif; wp_reset_query();?>

    <!-- #content -->
    </div>
    <!-- #primary -->
    <?php
    if($blog_archive_sidebar_position != 'none'){
    if(($blog_archive_sidebar_position == 'left' || $blog_archive_sidebar_position == 'both')){
    echo '<div class="sidebar sidebar_container_1 left" role="complementary"><div class="widget-area">';
    generated_dynamic_sidebar($blog_archive_left_sidebar );
    echo '</div></div>';
    }
    if($blog_archive_sidebar_position == 'right' || $blog_archive_sidebar_position == 'both'){
    echo '<div class="sidebar sidebar_container_2 right" role="complementary"><div class="widget-area">';
    generated_dynamic_sidebar($blog_archive_right_sidebar );
    echo '</div></div>';

    }
    }
    ?>
    <!-- .widget-area -->
    </div>
    </div>
    </div>
    <?php get_footer(); ?>

    #679332

    Nigel
    Supporter

    Languages: English (English ) Spanish (Español )

    Timezone: Europe/London (GMT+01:00)

    Screen Shot 2018-04-17 at 13.38.48.png

    See the screenshot for what is in the postmeta table in the database for the Conair post.

    It looks like you changed the slugs for the Types custom fields at some point.

    If you double-check the current settings at Toolset > Post Fields for example you will see that the name field has a slug of companyname (and so is stored in wp_postmeta as wpcf-companyname).

    That is there in the database, but so is the wrong data under wpcf-name.

    In your code in your PHP template you are using $name = (types_render_field("name", array('raw' => true) )); but the correct slug is companyname for that field.

    The other fields have the same problem.

    #680638

    You guys did an AWESOME job of figuring this out for me, and I very much appreciate the effort. That is just great technical support. I will sing your praises forever.

    The forum ‘Types Community Support’ is closed to new topics and replies.

    This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.