Hi Christian,
thanks for more shortcode it work fine and now the page looks like Profile CPT post.
But it don't work to display the "Sono di - Mio Profilo" View that it should display the current user position. I have duplicated all relative Content Template and add to the title name the " - Mio Profilo" string, and added to the shortcodes the "wpv-post-id", but nothing.
Other issue is in the gallery, I don't know why near the images are displayed "']" for every single image.
Now I'm trying to adeguate the shortcode to display the age and the category lists.
Hi, check now. I have removed the id attribute from the wpv-for-each loop, and replaced some square brackets with the curly bracket syntax:
<p style="text-align: center;">
{!{wpv-for-each field='wpcf-galleria'}!}
<a href="[types field='galleria' size='full' url='true' separator=',' id='[wpv-post-id]'][/types]" rel="lightbox">
[types field='galleria' alt='%%ALT%%' title='%%TITLE%%' width='240' height='170' align='left' resize='crop' separator=', ' id='[wpv-post-id]'][/types]
</a>
<br>
{!{/wpv-for-each}!}
</p>
Hi, thanks, now the gallery is displayed fine.
So, now I don't know how to display the correct vlues with my custom shortcodes...
To display the age into the Profile CPT post I use this code, but what snipped permit to display the correct age into the Page?
add_shortcode( 'iam-eta', 'wpv_post_age_shortcode');
function wpv_post_age_shortcode( $atts ) {
global $post;
$timestamp = get_post_meta( $post->ID, 'wpcf-data-di-nascita', true );
$age = floor((time() - $timestamp) / ( 60*60*24* 365 )) ;
return $age;
}
To display the category list in the Profile CPT post I use this code, but what code permit to display the category list in the page?
// Add Shortcode
function attivita_incontramici() {
$terms = get_the_terms($post->ID, 'attivita');
$count = count($terms);
if ( $count > 0 ) {
foreach ( $terms as $term ) {
$result .= "<li><span class='logo-serv'>" . $term->name . "</span></li>";
}
}
return "<ul class='servizi'>" . $result . "</ul>";
}
add_shortcode( 'attivita', 'attivita_incontramici' );
Our policy is to address one issue per ticket, so please create new tickets for each new issue. I have split this new issue into another ticket for you.
My issue is resolved now. Thank you!