Tagged: content template, Toolset, Views, Wp-types
-
AuthorPosts
-
March 20, 2015 at 9:11 am #415124
I am trying to use the Enfold theme together with WP-Types Toolset (http://wp-types.com/). It all works awesome except for one thing and that is when I try to output a single custom post template. I want it to override Enfolds default layout but it just get added below Enfolds default post template layout.
I have defined that the themes function is “require”.
I know that this isn’t a plugin that you have made, but I just want to know if you maybe have any input on this as to why this is happening? Why it do not override the enfold post template.
Kind regards,
Tobias
March 20, 2015 at 8:42 pm #415509Hey letobbe!
Is the plugin creating custom post types and your trying to load a custom template for the post type?
Your link is giving me a 404. We do not support third party plugins but go ahead and take a screenshot highlighting what is going on and we’ll see if there is anything we can do.
Best regards,
Elliott- This reply was modified 9 years, 9 months ago by Elliott.
March 24, 2015 at 12:23 am #416807Hi, sorry for that. I tried some changes on my own.
Is the plugin creating custom post types and your trying to load a custom template for the post type?
– YesBut I have found a partial solution to my problem.
I am currently using the following codesnippet in order to use the avia layout builder. But I am not using it, I only use it to override the regular custom post template (blog template). But the problem is that I have to actively go in and change on each new custom post I make so that it uses the Advanced Layout Builder.
This is not a solution I am looking for, I am looking for something similar that overrides the custom post template completely so I can use my own template.
http://pharmasys.adser.se/products/pharmaflex-swivel-elbow/
This link is a custom post type of mine but where I have not gone into the editor and changed to Advanced Layout Builder (so it uses the regular custom post type template from Enfold)http://pharmasys.adser.se/products/hme-10/
This link uses my own custom post type template because I have edited it and turned on Advanced Layout Builder (although I have not added any content with layout builder)I want the last result but without having to go into each new post and change it into advanced layout builder as all my custom post types are being created through a form.
If you could help me with this I would be forever grateful!
add_filter(‘avf_builder_boxes’, ‘add_builder_to_posttype’);
function add_builder_to_posttype($metabox)
{
foreach($metabox as &$meta)
{
if($meta[‘id’] == ‘avia_builder’ || $meta[‘id’] == ‘layout’)
{
$meta[‘page’][] = ‘ps-products’; /*instead add the name of the custom post type here*/
}
}return $metabox;
}March 24, 2015 at 8:30 pm #417366Hey!
I’m sorry but I’m not sure I understand. Are you trying to get the advanced layout editor to display when you edit your custom post types?
If so then see here, https://kriesi.at/support/topic/overriding-functions-in-a-child-theme/#post-167093.
Best regards,
ElliottMarch 24, 2015 at 9:59 pm #417427Okey, I might be a bit unclear. But basically I don’t want the avia layout builder. Neither do I want the template for custom post types that Enfold applies to everything.
I just want to be able to use my own template without Enfolds standard custom post template interferes.
How can I do that?
March 25, 2015 at 9:15 am #417612Maybe I can clear things up. See the following link http://pharmasys.adser.se/products/pharmaflex-swivel-elbow/
There you see
.blog-meta – with the small image.post-title entry-title – with the title and metainformation
Thenk you see the post content I want to show and nothing else which is the picture a table and a title
.av-share-box with the social sharing function
So what I want to do is to remove .blog-meta & .post-title entry-title & .av-share-box
But I just want it removed on certain custom post types that I have created (I still want it left intact on regular blog posts)
March 25, 2015 at 10:32 am #417645So I fixed it with css
#top.single-ps-products .fullsize .template-blog .post .entry-content-wrapper,
#top.single-ps-products .fullsize .template-blog .post .entry-content-wrapper > * { max-width: 100%; }
#top.single-ps-products .entry-content-header,
#top.single-ps-products .blog-meta,
#top.single-ps-products .av-share-box { display: none !important; }But this is not the most efficient way of doing it, I want to remove it from the loop so it doesn’t even render in the DOM. Is this possible?
Kind regards,
Tobias
March 26, 2015 at 1:35 pm #418483Hey there, I seem to be stuck with the same issue.
Content-Templates for Custom Post Types created in Views (from wp-types.com) do not work and are not displayed. Enfold shows the content instead with the standard post template.
Kriesi-Team, can you help (also with paid support here?) – Thanks!
March 26, 2015 at 3:26 pm #418526IQONOMY I have started a topic at WP-types aswell and I have a workaround solution
https://wp-types.com/forums/topic/content-template-doesnt-work-for-single-page-with-enfold/
“Please see it working, the issue has been resolved.
Actually, your theme was using a custom method/function to loop through the post content, while by-default Views and Content Template rely on WP’s default ‘the_content’ function.
So in such situations, Views has a quite nice option to debug your theme and find that custom method in use by your theme. And Views requires to input that function name under Views -> Settings -> “Theme support for Content Templates” – so your content templates can be rendered through your theme.
I have updated this settings. Your theme uses ‘require’ function to render the post content.”
So set the theme support for content templates to the required settings and then use my CSS code to remove the styling provided from Enfold Custom template.
Although I would rather remove it from the loop altogether.
March 27, 2015 at 8:48 pm #419603Hey!
Ok, thanks for posting your solution.
If your wanting to remove certain elements from the loop then the file your wanting to look at is /enfold/includes/loop-index.php and you can use this function to check if it’s a certain post type in the loop.
if ( get_post_type( $current_post['the_id'] ) == 'post_type' ) { }
Or you could also use CSS.
.post-your_type_here .post-title { display: none; }
Regards,
Elliott- This reply was modified 9 years, 8 months ago by Elliott.
-
AuthorPosts
- You must be logged in to reply to this topic.