-
AuthorPosts
-
February 1, 2017 at 7:02 pm #741399
I’ll be adding a custom meta box (ie: client name) for the portfolio posts. I’m familiar with the process of adding the meta box as well as adding the code to the loop to display the text specified in the meta box.
What I want to happen is display the custom meta box text content above the title when using the masonry portfolio. I wan’t able to find the loop I was looking for. Can you provide me guidance on how to accomplish this task?
Thanks a bunch!
February 1, 2017 at 7:40 pm #741414Hi CreativeFedora!
Please go to enfold/config-templatebuilder/avia-shortcodes/av-helper-masonry.php and add your custom field above following line
$items .= "<h3 class='av-masonry-entry-title entry-title' {$markup}>{$the_title}</h3>";
We would recommend you to use a child theme – http://kriesi.at/documentation/enfold/using-a-child-theme/ and apply the changes there – http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/
Cheers!
YigitFebruary 1, 2017 at 11:45 pm #741496Thanks for the guidance. I got the custom meta displaying on the portfolio post page.
However, I’m getting a syntax error, unexpected identifier (T_STRING) when I add the snippet to retrieve the meta box data when I add it to the av-helper-masonry,php file.
This is what I got going:
$items .= "<?php echo get_post_meta($post->ID, "client", true); ?>"; $items .= "<h3 class='av-masonry-entry-title entry-title client-name' {$markup}>{$the_title}</h3>";
February 2, 2017 at 12:32 am #741505Hey!
Please change your code to following
$items .= "<span class='custom-content'>". get_post_meta($post->ID, "client", true). "</span>"; $items .= "<h3 class='av-masonry-entry-title entry-title client-name' {$markup}>{$the_title}</h3>";
Cheers!
YigitFebruary 2, 2017 at 1:51 am #741514I appreciate the quick responses!
Is there anyway to include echo in front of get_post_meta()? In my experience echo is needed to display the meta box text on the front end.
February 2, 2017 at 2:04 pm #741773Hi,
That would throw error. If you are using a plugin such as – https://www.advancedcustomfields.com/, please refer to their documentation – https://www.advancedcustomfields.com/resources/
We do not mind taking a quick look however such customization is really out of the scope of our support unfortunately.Best regards,
YigitFebruary 2, 2017 at 8:25 pm #742012Thanks for the lead. I’ve implemented the plugin to no avail. I’m going to have to move forward from this. It would of been a fine feature to able to include a client name above the project title. Thanks for all your help.
February 3, 2017 at 3:23 pm #742393Hi,
Please feel free to request – or vote if already requested – such feature on Enfold feature request form.
For your information, you can take a look at Enfold documentation here – http://kriesi.at/documentation/enfold/
And if there are features that you wish Enfold had, you can request them and vote the requested ones here – https://kriesi.at/support/enfold-feature-requests/
For any other questions or issues, feel free to post them here on the forum and we will gladly try to help you :)Best regards,
Yigit -
AuthorPosts
- The topic ‘Custom Meta Box’ is closed to new replies.