Tagged: custom field, Custom Post Type, enfold, masonry
-
AuthorPosts
-
May 3, 2015 at 11:04 pm #438623
Hi guys, is there any way to use custom fields in the blog post/slider/grid/masonry list shortcodes on Enfold?
I have a page setup which pulls posts from my custom post type/taxonomy using the masonry element, but it only has options to show the title/excerpt etc. I have some other custom fields which I’d also like to show below the title and excerpt.
Please can you tell me how I can include the extra custom fields. I presume I would need to create a function or filter to hook into the shortcode, but I’m not sure how to do that. Please can you help?
Any advice is greatly appreciated!
Thank you
DuncanMay 5, 2015 at 4:09 am #439477Hey Duncan!
Yes, it’s possible. You’d need to edit the respective shortcode file (/config-templatebuilder/avia-shortcodes/) and include the meta value somewhere in the shortcode output.
Play with it and feel free to ask any questions regarding this but please be specific on what element you’re using.
Cheers!
JosueMay 5, 2015 at 11:11 am #439631Thanks Josue, I’ll have a go at including the meta key into the shortcode.
Ideally I’d like to create a function which does this, so that future updates of Enfold don’t overwrite the changes to the shortcode. Would that be possible? I’ll have a play and will reply back if I can’t get it work properly.
I know this may come under ‘customisation’ rather then theme support, but I’d really like to learn how to do it myself.
Thanks again for your help!
Duncan———-
UPDATE
———-
Ok, working with the masonry shortcode (masonry_entries.php), I can see that I need to add the meta values to $items (around line 620). Please can you tell me how I can create a function in my child theme which adds the meta values to that variable on line 620?- This reply was modified 9 years, 6 months ago by Dunc R.
May 5, 2015 at 4:54 pm #439849Hi!
There are no available hooks around that afaik so you’d need to overwrite the element source from your child theme, refer to this article:
http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/Regards,
JosueJune 3, 2016 at 8:41 am #642452Hi!!!
How can i change in masonry layout?
Like i want to add category of post as sub-heading on top of main heading and i want to add author with date, like in screenshot
http://take.ms/3i9fMThanx
June 3, 2016 at 2:58 pm #642567Hi,
You’d need to edit
/config-templatebuilder/avia-shortcodes/helper-masonry.php
can you post a link to your site so we can take a closer look?Best regards,
JosueJune 3, 2016 at 3:11 pm #642574Thanx @Josue for your reply
Actually I am working in Child theme, means i do not want updates to disturb my work in future…….
I already know about where i could make changes actually, but I don’t know how to handle this case living in child theme. Hope you can help me someway.
Site link is not yet available, i am working on localhost……
Regards!!!June 3, 2016 at 11:26 pm #642752Hi,
Duplicate helper-masonry.php in your child theme and include it from your child theme functions.php:
require("helper-masonry.php");
Best regards,
JosueJune 4, 2016 at 6:23 am #642835Oh, Thank you so much @Josue, that was pretty simple, (y)
June 4, 2016 at 12:34 pm #642912You are welcome, glad to help :)
Regards,
JosueJune 18, 2016 at 2:52 pm #650169Hi once again!
We have added helper-masonry.php through child theme functions.php and made changes in that file living in child theme….
can we add blog.php for modication as well to make changes in child theme?
Regards- This reply was modified 8 years, 5 months ago by hiddenpearls.
June 19, 2016 at 10:56 am #650396Hi,
/config-templatebuilder/avia-shortcodes/blog.php uses /includes/loop-index.php:
get_template_part( 'includes/loop', 'index' );
So that’s the file you’d want to mod.
Best regards,
JosueJune 20, 2016 at 9:29 am #650701Thanks once again
June 21, 2016 at 8:25 pm #651692Hi,
glad we could help. Let us know in a new ticket if you have some more questions related to the theme. We are happy to assist you.
Best regards,
Andy -
AuthorPosts
- The topic ‘Masonry / blog post list with custom post type and custom fields’ is closed to new replies.