Tagged: custom post types, custom posts
-
AuthorPosts
-
April 16, 2015 at 11:50 am #429529
Hi guys,
I hope you can assist me with this. I’m developing an e-learning courses platform, and it makes use of custom post types.
However it seems like Enfold is treating these custom posts, ie my courses, quizzes and modules the same way it treats blog posts in that it’s including the post meta info (author and category etc) and all the social sharing buttons and comments that come with the blog posts.
How do I stop the theme from including all these unecessary elements?
Courses for example can’t have sharing buttons because they’re behind a pay wall.
Thank you.
Brendon
April 17, 2015 at 11:26 am #430238Hi inMotionGraphics!
you can hide post meta info using this code:
.post-meta-infos { display: none; }
To hide social share:
.av-share-box { display: none; }
Regards,
AndyApril 17, 2015 at 12:47 pm #430273Hi Andy,
Thanks for getting back to me.
However the code you provided is CSS code, and will hide it accross the entire site, including the blog.
What I actually meant is how to stop the custom posts template from including all this info in the first place. We also don’t want the entire weight of the social sharing code to be loaded throughout our courses system, so just hiding it visually isn’t going to be an optimal solution.
Something in the theme is causing the custom posts to be treated like blog posts, which is what we need to change.
Thank you.
Brendon
April 19, 2015 at 7:28 am #430822Hi!
Add the custom post type’s class selector:
.single-sfwd-courses .post-meta-infos { display: none; }
Regards,
IsmaelApril 20, 2015 at 9:46 am #431173Hi Ismael,
Thank you for your reply.
Unfortunately this is still the exact same solution as Andy’s. Hiding the elements via CSS doesn’t address the issue we are having. The entire course system (custom posts) is still being treated like part of the blog, which is not correct. Another issue I didn’t mention is that throughout our courses system, the heading sections has the name of our blog in it: “The Real Estate Agent Blog”. This makes no sense and should rather say something like the title of our courses page or contain the current page title.
I don’t want to just hide these elements via CSS, because it means they still have to be loaded, which adds unnecessary overhead to our entire courses platform. The shouldn’t be there at all if you know what I mean. As per my original question, how do I stop these custom post types from being treated like blog posts? Or how do I edit the custom posts template to not include all these elements we don’t need?
I hope this makes more sense now.
Thank you.
Brendon
April 21, 2015 at 9:52 pm #432404Hi Brendon!
You’d need to create a
single-courses.php
template file so you can have full control over the structure of the single view of a Course, you can use the contents of Enfoldsingle.php
as a model.Cheers!
JosueApril 23, 2015 at 1:34 am #433188Hi Josue,
This worked out perfectly! Thank you very much for the tip.
Brendon
April 23, 2015 at 4:39 am #433214You are welcome Brendon, glad to help :)
Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.