[Resolved] is breaking output

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.

Our next available supporter will answer your ticket in about 2.46 hours from now. Thank you for your understanding.

You are not logged in. You can view support threads, but not post.
If you are already logged in, please refresh your browser.

Related documentation: Views API

This topic contains 7 replies, has 2 voices, and was last updated by  Jerome 3 days, 4 hours ago. The support staff assigned to this topic is Minesh.

Viewing 8 posts - 1 through 8 (of 8 total)
Author
Posts
#577528

Hey Moderators, Should this code still work?
<?php WPV_wpcf_record_post_relationship_belongs(''); ?>
I have this in a few old page templates and these are now breaking. I have commented them out for the moment. What should this be changed to now?

Thanks
Jerome

#577530

Sorry thought I should add a little more info. I am using Posts2Posts and listing all the artworks in an exhibition. Under each artwork I had the name of the artist listed. This is especially important when multiple artists are in the one exhibition. This was working until I updated to the latest version of Types and Views. Now It breaks output. When I remove:

<?php WPV_wpcf_record_post_relationship_belongs(''); ?>

The Title of the artwork shows twice.
When I then comment out:

<?php echo do_shortcode('[wpv-post-title id="$artist"]'); ?>

The page loads fine and no issues but the artists name won't show up.

How can I fix this to list the artists name under each work.

Thanks
Jerome

#577605

Minesh
Forum moderator

Supporter languages: English (English )

Supporter Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - it looks like really old function you are using. I need to see how and where you are using the function: WPV_wpcf_record_post_relationship_belongs('');

Can I have problem URL and temporary access details so I can check your issue further with information what should be your expected output.

#578251

Minesh
Forum moderator

Supporter languages: English (English )

Supporter Timezone: Asia/Kolkata (GMT+05:30)

Thank you for sharing access details. I will check this tomorrow first thing and give you feedback on it.

#578446

Minesh
Forum moderator

Supporter languages: English (English )

Supporter Timezone: Asia/Kolkata (GMT+05:30)

Exhibition page: http://gallery-one.com.au/exhibition/suey-mcennally-2/
==> For above page I checked in the database there is no parent key (_wpcf_belongs_artist_id) exists in postmeta table which stores the parent ID of artists belongs to above post BUT with p2p table I can see artist_to_exhibition relationship is stored.

Please check following screenshot:
=> https://s.nimbus.everhelper.me/share/1175747/11l1xgmiu3wfha2c55fb

Then I've tried to add following code to file: File: single-exhibition.php -

$connected_artist = new WP_Query( array(
  'connected_type' => 'artist_to_exhibition',
  'connected_items' => get_queried_object(),
  'nopaging' => true,
) );


foreach($connected_artist->posts as $k=>$v):
      echo "<br />Connected Artists=".$v->post_title;
endforeach;

And I can see artist post title on frontend. Could you please try to modify your template files with above such code and try to resolve your issue.

#579224

While that is helpful that does not fix my issue. The issue is that I want to pull the artist for each artwork. Some exhibitions or label runs have multiple artworks by multiple artists. When it calls each artwork, the artwork should have an artist parent under the field _wpcf_belongs_artist_id so how would that be pulled for each artwork. If you reload that same page the artists name should appear underneath each artwork title on the second line.

#579545

Minesh
Forum moderator

Supporter languages: English (English )

Supporter Timezone: Asia/Kolkata (GMT+05:30)

I can see now with template file it shows different artwork. do you still need help?
=> http://your-domain.au/label/mel-brigg-exhibition-2017/?view-template=labels

#579728

I managed to fix it myself using the following code in the for each artwork statement:

<?php
$artist_id = wpcf_pr_post_get_belongs( get_the_ID(), 'artist' );
// Get all the parent (writer) post data
$artist_post = get_post( $artist_id );
	$artist_name = $artist_post->post_title;
	echo '<strong>' . $artist_name . '</strong>'; ?>

Thanks
Jerome

Viewing 8 posts - 1 through 8 (of 8 total)

You are not logged in. You can view support threads, but not post.
If you are already logged in, please refresh your browser.