Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #288538

    Can i add tags or some custom fields (i’m using Advanced Custom Fields) on a Portfolio Grid layout behind excerpt?
    many thx!

    #288539

    Hi housedada!

    Can you elaborate please? A screenshot showing changes you would like to make would help

    Regards,
    Yigit

    #288602

    Of course, here a little example: https://imageshack.com/i/nll7y6p

    ..and this is the part of code inside portfolio.php, how i can add some custom fields from plugin “Advanced Custom Fields”?

    if(!empty($title))
    {
    $markup = avia_markup_helper(array(‘context’ => ‘entry_title’,’echo’=>false, ‘id’=>$the_id, ‘custom_markup’=>$custom_markup));
    $output .= ‘<header class=”entry-content-header”>’;
    $output .= “<h3 class=’grid-entry-title entry-title’ $markup>“.$title.”</h3>”;
    $output .= ‘</header>’;
    }
    $output .= !empty($excerpt) ? “<div class=’grid-entry-excerpt entry-content’ “.avia_markup_helper(array(‘context’=>’entry_content’,’echo’=>false, ‘id’=>$the_id, ‘custom_markup’=>$custom_markup)).”>”.$excerpt.”</div>” : ”;
    $output .= !empty($title) || !empty($excerpt) ? “</div>” : ”;
    $output .= ‘<footer class=”entry-footer”></footer>’;
    $output .= “</article>”;
    $output .= “</div>”;

    #288785

    Hi!

    Thank you for using the theme!

    First, using the plugin create a custom field called portfolio-test for example. Edit admin > register-portfolio.php, find this code on line 38:

    'supports' => array('title','thumbnail','excerpt','editor','comments')
    

    Replace it with:

    'supports' => array('title','thumbnail','excerpt','editor','comments','custom-fields')
    

    This will enable the custom fields or portfolio items. Next edit the portfolio item then add the portfolio-test custom field. Edit config-templatebuilder > avia-shortcodes > portfolio.php find this code on line 471:

    $output .= !empty($excerpt) ? "<div class='grid-entry-excerpt entry-content' ".avia_markup_helper(array('context'=>'entry_content','echo'=>false, 'id'=>$the_id, 'custom_markup'=>$custom_markup)).">".$excerpt."</div>" : '';
    

    Replace it with this:

    $custom_field1 = get_post_meta( $the_id, 'portfolio-test', true );
    					 
                        $output .= !empty($excerpt) ? "<div class='grid-entry-excerpt entry-content' ".avia_markup_helper(array('context'=>'entry_content','echo'=>false, 'id'=>$the_id, 'custom_markup'=>$custom_markup)).">".$excerpt."</div>" : '';
    					$output .= $custom_field1;

    We create a variable called $custom_field1 and applied the portfolio-test key. We then output the $custom_field1 below the excerpt.

    Best regards,
    Ismael

    #289013

    Perfect, many thx!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Add Tags on Portfolio Grid’ is closed to new replies.