Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Dante › does DANTE support custom post types?
New Landing › How can we help? › Themeforest Theme Support › Dante › does DANTE support custom post types?
- This topic has 42 replies, 6 voices, and was last updated 10 years by Swift Ideas – Ed.
-
Posted in: Dante
-
November 28, 2013 at 8:44 am #34062
i want to show my custom post types “books” in a grid view, or in masonry… how can i archieve this? also i want to change the layout a little bit, so that i also can display the “author” of the books directly below the title of the custom post type item in the masonory or grid view…. how can i do this? thanks
November 28, 2013 at 4:28 pm #34212Hi @neotemplates,
As it currently stands, Dante doesn’t support using it’s page builder elements for custom post types out the box.
However, you could definitely re-purpose the page builder assets to suit your custom post types, and add those elements to the page builder for you to use, through the child theme. That would give you ultimate flexibility over the content you are able to display.
We’ve got it on our list to investigate the best way to allow custom post type usage within the blog assets, but a lot of the time it’s much cleaner to create a new asset.
Hope that helps, I know it’s not too in-depth, but something like that is likely what we’ll write a knowledgebase article covering soon!
Thanks,
– Ed
December 3, 2013 at 10:18 am #34980ok thanks for your answer, how do i create a new asset?
December 4, 2013 at 7:30 pm #35312You can create a new asset by adding a file to your child theme, copying from any of the page builder asset files from /swift-framework/page-builder/builder/shortcodes/ .
You’ll then want to add the following function the child theme functions.php file:
function register_new_pbassets() { require_once( get_stylesheet_directory_uri() . '/custom-shortcode.php' ); } if (is_admin()) { add_action('admin_init', 'register_new_pbassets', 2); } if (!is_admin()) { add_action('wp', 'register_new_pbassets', 2); }
I’ll be writing up a knowledgebase article for this in the coming weeks!
– Ed
December 13, 2013 at 7:24 pm #37028Ooooh….
It Sounds great!!
Do you have more information of this issue?
Thanks very much
December 16, 2013 at 6:00 pm #37481Not yet, but will write it up as soon as I get the chance!
– Ed
April 22, 2014 at 9:08 pm #69238+1 for me too.
April 23, 2014 at 10:07 am #69347June 1, 2014 at 2:27 pm #79307I’m running into the same issue as the page builder doesn’t pull in the custom post type added through a plugin. I tried what Ed suggested in the previous response but it didn’t work for me.
Can anybody further explain in details how I would go about fixing this? I appreciate any help I can get.
Thanks!June 2, 2014 at 12:14 pm #79526Hi @msc-val,
Those are to add/remove assets. To add custom post types, edit /swift-framework/page-builder/builder/lib/builder.php lines 42/44 and add your post type there:
if ($enable_pb_product_pages) { $this->postTypes = $pt_array ? $pt_array : array('page', 'post', 'portfolio', 'product', 'team', 'jobs', 'ajde_events',); } else { $this->postTypes = $pt_array ? $pt_array : array('page', 'post', 'portfolio', 'team', 'jobs', 'ajde_events'); }
Hope that helps.
– Ed
June 2, 2014 at 3:15 pm #79577Thank you @Ed for your response,
That actually turned on the Swift Page Builder for this custom post type as it wasn’t available before. But this custom post type is still not supported by the theme since nothing is being outputted on the website.
Here is my scenario. I use the Page builder to select recent posts or blog carousel, select the category that I want to display (which has plenty of content), then publish it but no content is being displayed. I can see the widget title that I assigned but nothing underneath it.
Moreover, I published the Sitemap element from the Page Builder and it displays just the posts, pages, archive and categories. But it doesn’t show any of the custom post type content.
I really appreciate any help I can get.
Thanks againJune 2, 2014 at 4:57 pm #79619@msc-val ahh ok. Well, for custom post type content to be output using the page builder assets, you’d need to create your own assets. The original assets won’t pull in content from those, as of yet.
– Ed
June 2, 2014 at 5:05 pm #79620Thank you @Ed,
Would you please clarify further. And please don’t spare me the details/steps of how I would go about creating the asset. It is a high priority for me as the whole content of the site is going to be created through this custom post type.Thank you so much!
June 2, 2014 at 5:19 pm #79621Hi @msc-val,
I can’t go into too much detail of it, as it is outside the support scope (customisations), and I simply don’t have enough time – but I’ll say what I can.
See the code here:
function register_new_pbassets() { require_once( get_stylesheet_directory_uri() . '/custom-shortcode.php' ); } if (is_admin()) { add_action('admin_init', 'register_new_pbassets', 2); } if (!is_admin()) { add_action('wp', 'register_new_pbassets', 2); }
That is used to add your custom shortcode into the builder. You can then take any of the page builder shortcode files, duplicate it, and change the contents to match what you need. It’s a relatively moderate task for a developer with a bit of knowledge. If it’s not something you are competent with then it would be a pretty easy task for a freelancer.
Hope that helps.
– Ed
June 2, 2014 at 7:30 pm #79651This reply has been marked as private. -
Posted in: Dante
You must be logged in and have valid license to reply to this topic.