-
Author
-
March 28, 2017 at 21:44 #156977wilfriedMarseilleParticipant
Hello
I make a custom post type.
I want display some Advance Custom Field.
If i want show a image, or a text zone is okay.
B
ut When i try to get information from the ACF Author.
I get ( Pic, Name, Role … )So i try to select with a php code but i can’t get it.
I let you my code
This is the code for select a ID from author data array but is not working 🙁
` <?php //Afficher auteur Name
$ACF_telechargement_auteur = get_field(‘telechargement_auteur’);
if( !empty($ACF_telechargement_auteur) ): ?>
<?php echo $ACF_telechargement_auteur[5]; ?>
<?php endif; ?>
`
And this is the code who show all the Author array
`<?php the_field(‘telechargement_auteur’, $term); ?>`you can chek the page with this link : http://www.zikrea.com/telechargements/exemple/
If you love Ableton check my blog :
www.zikrea.comMarch 28, 2017 at 21:45 #156978wilfriedMarseilleParticipantAnd this is the code of the single-page-slug.php
COPY CODE<?php /** * The Template for displaying all single posts * * @package WordPress * @subpackage Kleo * @since Kleo 1.0 */ get_header(); ?> <?php //Specific class for post listing */ if ( kleo_postmeta_enabled() ) { $meta_status = ' with-meta'; if ( sq_option( 'blog_single_meta', 'left' ) == 'inline' ) { $meta_status .= ' inline-meta'; } add_filter( 'kleo_main_template_classes', create_function( '$cls','$cls .= "' . $meta_status . '"; return $cls;' ) ); } /* Related posts logic */ $related = sq_option( 'related_posts', 1 ); if ( ! is_singular('post') ) { $related = sq_option( 'related_custom_posts', 0 ); } //post setting if(get_cfield( 'related_posts') != '' ) { $related = get_cfield( 'related_posts' ); } ?> <?php get_template_part( 'page-parts/general-title-section' ); ?> <?php get_template_part( 'page-parts/general-before-wrap' );?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <!-- Begin Disposition --> <div class ="aligncenter"> <!-- Les champs à afficher --> <!-- Les champs ACF Texte --> <h1><?php the_field('telechargement_serie', $term);?></br><?php the_field('ACF_telechargement_nom', $term); ?></h1> <?php the_field('lien_youtube', $term)?> <?php //Afficher auteur Name $ACF_telechargement_auteur = get_field('telechargement_auteur'); if( !empty($ACF_telechargement_auteur) ): ?> <?php echo $ACF_telechargement_auteur[5]; ?> <?php endif; ?> <?php the_field('telechargement_auteur', $term); ?> <?php $author_id = get_the_author_meta('ID'); $author_badge = get_field('author_badge', 'user_'. $author_id ); ?> <img src="<?php echo $author_badge['url']; ?>" alt="<?php echo $author_badge['alt']; ?>" /> </div> <!-- Begin Comments --> <div class="aligncenter"> <h4 class="titleComments">Une question, une remarque, 3avis ?</h4> <h4>Laissez nous un commentaire.</h4> </div> <?php if ( comments_open() || get_comments_number() ) { comments_template( '', true ); } ?> <!-- End Comments --> <?php get_template_part( 'page-parts/posts-social-share' ); ?> <?php if( $related == 1 ) { get_template_part( 'page-parts/posts-related' ); } ?> <?php if ( sq_option( 'post_navigation', 1 ) == 1 ) : // Previous/next post navigation. kleo_post_nav(); endif; ?> <?php endwhile; ?> <?php get_template_part('page-parts/general-after-wrap');?> <?php get_footer(); ?>
If you love Ableton check my blog :
www.zikrea.comMarch 30, 2017 at 00:38 #157157LauraModeratorHello, will assign the ticket to a higher support level who can help and advise you in your query.
Thanks! ?Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionLaura Solanes - Graphic Designer and Web Designer
Please be patient as I try to answer each topic as fast as i can.
If you like the theme or the support you've received please consider leaving us a review on Themeforest!
Always happy to help you 🙂
March 30, 2017 at 19:24 #157245RaduModeratorHi,
We cannot offer support for custom development you can ask for an example code from acf plugin
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
The forum ‘Bugs & Issues’ is closed to new topics and replies.